apache / apache/lucene

Sorting Facets on CategoryPath (Label) [LUCENE-5370]

Open
#6,434 6 comments 0 reactions 0 assignees View on GitHub
affects-version:4.6 legacy-jira-label:features legacy-jira-priority:Major module:facet type:enhancement
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

Facet support sorting through `FacetRequest.SortOrder`. This is used in the `ResultSortUtils`. For my application it would be very nice if the facets can also be sorted on their label.

I think this could be accomplished by altering `FacetRequest` with an extra enum `SortType`, and two extra `Heap` in `ResultSortUtils` which instead of comparing the double value, compare the CategoryPath.

What do you think of this idea? Or could the same behaviour be accomplished in a different way already?

(btw: I tried building this patch on the trunk of lucene5.0; but I couldn't get the maven build to build correctly. I will try again lateron on the 4.6 branch.

---
Migrated from [LUCENE-5370](https://issues.apache.org/jira/browse/LUCENE-5370) by Rob Audenaerde, updated Mar 24 2014

Contributor guide

Open the contributing guide

Research direction

Start by reading FacetRequest.SortOrder and ResultSortUtils to understand the current numeric facet sorting and how CategoryPath values are available. Decide how label sorting should fit the existing API, then verify that facet results can be ordered by CategoryPath label as requested without breaking numeric sorting.

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
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.