Document Evaluation for Sorting Results, Lucene

Even after going through the sort field, evaluating the document leads to the sort order of the search results. Is there a way to get lucene to ignore document evaluation when passing a specific sort field?

For example:

DocId    Score        SortFieldA        SortFieldB
  1      23.0041      200906030800      Test
  2      32.2774      200906020800      Test
  3      21.0632      200906030800      Apple

I want the results to be sorted first by SortFieldA and then by SortFieldB. Therefore, in the above case, the results should be returned as doc2, doc3 and doc1. But because of the indicator, the sort order is upset.

I noticed that the results are sorted correctly if the documents have the same rating.

Code that sets the sort fields:

public override Sort GetSort()
    {
      List<SortField> sortFields = new List<SortField>();      
      sortFields.Add(new SortField(StartDateTime.ToString(), SortField.STRING, ReverseSort));
      sortFields.Add(new SortField(TitleSort.ToString(), SortField.STRING, ReverseSort));
      return new Sort(sortFields.ToArray());
    }
+3
source share
1 answer

: , , ConstantScoreQuery, , .

.

0

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


All Articles