File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
server/src/main/java/org/elasticsearch/index/fielddata Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -96,13 +96,12 @@ public final SortField sortField(
9696 * 3. We Aren't using max or min to resolve the duplicates.
9797 * 4. We have to cast the results to another type.
9898 */
99- boolean optimizeSortWithPoints = isIndexed ()
100- && nested == null
101- && (sortMode == MultiValueMode .MAX || sortMode == MultiValueMode .MIN )
102- && targetNumericType == getNumericType ();
103- if (sortRequiresCustomComparator () || optimizeSortWithPoints == false ) {
99+ boolean requiresCustomComparator = nested != null
100+ || (sortMode != MultiValueMode .MAX && sortMode != MultiValueMode .MIN )
101+ || targetNumericType != getNumericType ();
102+ if (sortRequiresCustomComparator () || requiresCustomComparator ) {
104103 SortField sortField = new SortField (getFieldName (), source , reverse );
105- sortField .setOptimizeSortWithPoints (optimizeSortWithPoints );
104+ sortField .setOptimizeSortWithPoints (requiresCustomComparator == false && isIndexed () );
106105 return sortField ;
107106 }
108107
You can’t perform that action at this time.
0 commit comments