You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2023/01/12 15:24:44 UTC

[GitHub] [lucene] jpountz commented on a diff in pull request #12078: Enhance XXXField#newRangeQuery

jpountz commented on code in PR #12078:
URL: https://github.com/apache/lucene/pull/12078#discussion_r1068260998


##########
lucene/core/src/java/org/apache/lucene/document/LongField.java:
##########
@@ -108,8 +109,9 @@ public static Query newExactQuery(String field, long value) {
    */
   public static Query newRangeQuery(String field, long lowerValue, long upperValue) {
     PointRangeQuery.checkArgs(field, lowerValue, upperValue);
+    Query fallbackQuery = LongPoint.newRangeQuery(field, lowerValue, upperValue);
     return new IndexOrDocValuesQuery(
-        LongPoint.newRangeQuery(field, lowerValue, upperValue),
+        new IndexSortSortedNumericDocValuesRangeQuery(field, lowerValue, upperValue, fallbackQuery),
         SortedNumericDocValuesField.newSlowRangeQuery(field, lowerValue, upperValue));

Review Comment:
   I would have wrapped the IndexOrDocValuesQuery within the IndexSortSortedNumericDocValuesRangeQuery instead. IndexOrDocValuesQuery is needed because the point query is bad at skipping and the doc values query is bad at iterating over all matches, but when an index sort is configured, `IndexSortSortedNumericDocValuesRangeQuery` is good at both so it should take precedence over both the index and the doc-values query?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org