lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ferenczi Jim (JIRA)" <>
Subject [jira] [Updated] (LUCENE-7537) Add multi valued field support to index sorting
Date Tue, 08 Nov 2016 10:28:58 GMT


Ferenczi Jim updated LUCENE-7537:
    Attachment: LUCENE-7537.patch

Here is a simple patch that adds the support for multi valued sort directly in SortField.
It defines 5 new sort types: sorted_string, sorted_long, sorted_double, sorted_float, sorted_int
and uses the Sorted{Set|Numeric}Selector for sorting. The natural order picks the minimum
value of the list for each document and the reverse order picks the maximum.

This patch also fixes a small bug which showed up in unit tests when using an index sorting
with reverse sort and a missing value.

> Add multi valued field support to index sorting
> -----------------------------------------------
>                 Key: LUCENE-7537
>                 URL:
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: core/index
>            Reporter: Ferenczi Jim
>         Attachments: LUCENE-7537.patch
> Today index sorting can be done on single valued field through the NumericDocValues (for
numerics) and SortedDocValues (for strings).
> I'd like to add the ability to sort on multi valued fields. Since index sorting does
not accept custom comparator we could just take the minimum value of each document for an
ascending sort and the maximum value for a descending sort.
> This way we could handle all cases instead of throwing an exception during a merge when
we encounter a multi valued DVs. 

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message