How to apply default collation in lucene on equal terms?

Good day,

If I have, for example, documents that have the following fields

Person_name - Birthday
Jordan - 2009-06-15
Marc - 2009-01-01
Marcos - 2009-01-01
Marcissh_something_something - 2009-06-15
Marcos - 2009-12-31

And when searching for Person_name: Marc * I got the following ratings (the estimates here are hypothetical)

Person_name - Birthday - Score
Jordan - 2009-06-15 - 0.0
Marc - 2009-01-01 - 1.0
Marcos - 2009-01-01 - 0.8
Marcissh_something_something - 2009-06-15 - 0.1
Marcos - 2009-12-31 - 0.8

How to get the result so that the result is first sorted by relevance, and then assumed that the same relevance (rating) is sorted by date of birth in descending order .... so the result

Person_name - Birthday - Score
Marc - 2009-01-01 - 1.0
Marcos - 2009-12-31 - 0.8
Marcos - 2009-01-01 - 0.8
Marcissh_something_something - 2009-06-15 - 0.1

thanks

+3
source share
2 answers

ScoreDocComparator, , . FieldComparator. TopFieldCollector Sort . , , .

+1

, . , , .

+1

Source: https://habr.com/ru/post/1722305/


All Articles