Offer better support for onMissingValue().use(Object) in the sort DSL

Description

Providing a replacement for missing values in the sort DSL currently has two limitations:

1. One can only use it with numeric values, because org.apache.lucene.search.SortField.setMissingValue(Object) does not accept replacements for String values, and a SortField is what we return ultimately.
2. Field bridges are ignored, because:

  • Field bridges cannot convert an object to a numeric value (the most they can do is provide a String value by implementing StringBridge), but org.apache.lucene.search.SortField.setMissingValue(Object) expects numeric values for numeric fields, and a SortField is what we return ultimately. Note that setMissingValue won't break right away, but org.apache.lucene.search.SortField.getComparator(int, int) (called before sorting) will.

  • String values are irrelevant (see 1. above)

These limitations should go away when dropping the reliance on the Lucene API in HS 6.0. Allowing to use field bridges on numeric fields might require some more work, though.

Activity

Show:

Yoann Rodière April 2, 2019 at 12:32 PM

The part about using field briges was already fixed in Search 6.

The other problems will be fixed as part of HSEARCH-3254, and HSEARCH-3387.
Closing as out of date.

Out of Date

Details

Assignee

Reporter

Components

Priority

Created August 22, 2016 at 9:03 AM
Updated April 2, 2019 at 12:32 PM
Resolved April 2, 2019 at 12:32 PM