apache / apache/lucene

Group sort by numFound [LUCENE-6126]

Open
#7,188 0 comments 0 reactions 0 assignees View on GitHub
legacy-jira-priority:Major type:enhancement
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

Currently, the doing a group query gives the response in the following manner:
grouped":{
"field_name: value":{
"matches":5,
"doclist":{"numFound":3,"start":0,"docs":[{ ... }]
}}

There should be a way to sort the groups. One way of doing it would be to store a field in the index and apply sort on that.

But, having a way to sort groups according to "numFound" would be better than storing temp fields for this purpose.

---
Migrated from [LUCENE-6126](https://issues.apache.org/jira/browse/LUCENE-6126) by Prateek Sachan

Contributor guide

Open the contributing guide

Research direction

The issue names no source files, tests, or entry points. Start by locating the grouping and response-sorting implementation, then determine how group ordering is represented and tested. Done means grouped results can be ordered by numFound without requiring a temporary indexed field.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
search
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.