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 2022/03/15 17:59:32 UTC
[GitHub] [lucene] reta opened a new pull request #749: LUCENE-10466: IndexSortSortedNumericDocValuesRangeQuery unconditionally assumes the usage of the LONG-encoded SortField
reta opened a new pull request #749:
URL: https://github.com/apache/lucene/pull/749
# Description
IndexSortSortedNumericDocValuesRangeQuery unconditionally assumes the usage of the LONG-encoded SortField. Using the numeric range query (in case of sorted index) with anything but LONG ends up with class cast exception.
```
> java.lang.ClassCastException: class java.lang.Long cannot be cast to class java.lang.Integer (java.lang.Long and java.lang.Integer are in module java.base of loader 'bootstrap')
> at org.apache.lucene.search.comparators.IntComparator.setTopValue(IntComparator.java:29)
> at org.apache.lucene.sandbox.search.IndexSortSortedNumericDocValuesRangeQuery.loadComparator(IndexSortSortedNumericDocValuesRangeQuery.java:251)
> at org.apache.lucene.sandbox.search.IndexSortSortedNumericDocValuesRangeQuery.getDocIdSetIterator(IndexSortSortedNumericDocValuesRangeQuery.java:206)
> at org.apache.lucene.sandbox.search.IndexSortSortedNumericDocValuesRangeQuery$1.scorer(IndexSortSortedNumericDocValuesRangeQuery.java:170)
```
# Solution
The `IndexSortSortedNumericDocValuesRangeQuery` should consult the numeric type of the `SortField` and perform appropriate conversions.
# Tests
Added the test cases for LONG / INT / FLOAT / DOUBLE fields.
# Checklist
Please review the following and check all that apply:
- [X] I have reviewed the guidelines for [How to Contribute](https://wiki.apache.org/lucene/HowToContribute) and my code conforms to the standards described there to the best of my ability.
- [X] I have created a Jira issue and added the issue ID to my pull request title.
- [X] I have given Lucene maintainers [access](https://help.github.com/en/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork) to contribute to my PR branch. (optional but recommended)
- [ ] I have developed this patch against the `main` branch.
- [X] I have run `./gradlew check`.
- [X] I have added tests for my changes.
--
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
[GitHub] [lucene] reta commented on pull request #749: LUCENE-10466: IndexSortSortedNumericDocValuesRangeQuery unconditionally assumes the usage of the LONG-encoded SortField
Posted by GitBox <gi...@apache.org>.
reta commented on pull request #749:
URL: https://github.com/apache/lucene/pull/749#issuecomment-1082506007
> Thanks! I think `NumericDocValuesField` accepts floating point types as well (see the `FloatDocValuesField` subclass for example). It is the single-valued version of `SortedNumericDocValuesField`.
Right, but the `FloatDocValuesField` still converts to `long` to fulfill `NumericDocValuesField` contract, mostly following the same path as we do in this pull request (or better to say, this pull request takes the same conversion path).
--
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
[GitHub] [lucene] reta commented on a change in pull request #749: LUCENE-10466: IndexSortSortedNumericDocValuesRangeQuery unconditionally assumes the usage of the LONG-encoded SortField
Posted by GitBox <gi...@apache.org>.
reta commented on a change in pull request #749:
URL: https://github.com/apache/lucene/pull/749#discussion_r839872948
##########
File path: lucene/sandbox/src/java/org/apache/lucene/sandbox/search/IndexSortSortedNumericDocValuesRangeQuery.java
##########
@@ -318,6 +326,17 @@ private static ValueComparator loadComparator(
};
}
+ private static Number convert(Type type, long topValue) {
+ if (type == Type.INT) {
+ return (int) topValue;
+ } else if (type == Type.LONG) {
+ return topValue;
+ } else {
+ throw new IllegalArgumentException(
Review comment:
@jtibshirani I kept the decision point in one place (`convert` method), in case conversion is not available - the absence of value comparator is propagated to `getDocIdSetIteratorOrNull`, please let me know what do you think.
--
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
[GitHub] [lucene] reta commented on pull request #749: LUCENE-10466: IndexSortSortedNumericDocValuesRangeQuery unconditionally assumes the usage of the LONG-encoded SortField
Posted by GitBox <gi...@apache.org>.
reta commented on pull request #749:
URL: https://github.com/apache/lucene/pull/749#issuecomment-1082488464
Thanks @jtibshirani
> I think this only fixes the problem if the documents have SortedNumericDocValuesField but not NumericDocValuesField?
That is correct, only for `SortedNumericDocValuesField`, the `NumericDocValuesField` operates on `long` values only so it never runs into the same issue (luckily).
> To me it'd be best to only tackle the main bug you ran into, the ClassCastException when using integers. To prevent errors when using double and float values, we could add an explicit check and disable the optimization in this case, and clarify in the javadoc that only LONG and INT are supported.
Sure, I can do that.
--
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
[GitHub] [lucene] jtibshirani commented on pull request #749: LUCENE-10466: IndexSortSortedNumericDocValuesRangeQuery unconditionally assumes the usage of the LONG-encoded SortField
Posted by GitBox <gi...@apache.org>.
jtibshirani commented on pull request #749:
URL: https://github.com/apache/lucene/pull/749#issuecomment-1069465953
Thanks @reta! This is on my list of PRs to review, I'd just like to wait until https://github.com/apache/lucene/pull/736 wraps up as it might affect this logic a bit.
Also I noticed it targets branch_9_0 -- our usual dev workflow is for PRs to target the `main` branch. Once it's merged, the reviewer will backport and push to the release branches.
--
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
[GitHub] [lucene] nknize commented on a change in pull request #749: LUCENE-10466: IndexSortSortedNumericDocValuesRangeQuery unconditionally assumes the usage of the LONG-encoded SortField
Posted by GitBox <gi...@apache.org>.
nknize commented on a change in pull request #749:
URL: https://github.com/apache/lucene/pull/749#discussion_r831316035
##########
File path: lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestIndexSortSortedNumericDocValuesRangeQueryByType.java
##########
@@ -0,0 +1,126 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.sandbox.search;
+
+import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
+import java.util.Arrays;
+import org.apache.lucene.document.Document;
+import org.apache.lucene.document.SortedNumericDocValuesField;
+import org.apache.lucene.index.DirectoryReader;
+import org.apache.lucene.index.IndexWriterConfig;
+import org.apache.lucene.search.IndexSearcher;
+import org.apache.lucene.search.Query;
+import org.apache.lucene.search.Sort;
+import org.apache.lucene.search.SortField;
+import org.apache.lucene.search.SortedNumericSortField;
+import org.apache.lucene.store.Directory;
+import org.apache.lucene.tests.analysis.MockAnalyzer;
+import org.apache.lucene.tests.index.RandomIndexWriter;
+import org.apache.lucene.tests.util.LuceneTestCase;
+
+public class TestIndexSortSortedNumericDocValuesRangeQueryByType extends LuceneTestCase {
+ private final SortField.Type type;
+
+ public TestIndexSortSortedNumericDocValuesRangeQueryByType(SortField.Type type) {
+ this.type = type;
+ }
+
+ @ParametersFactory(argumentFormatting = "type=%s")
+ public static Iterable<Object[]> parametersWithCustomName() {
+ return Arrays.asList(
+ new Object[][] {
+ {SortField.Type.INT},
+ {SortField.Type.FLOAT},
+ {SortField.Type.LONG},
+ {SortField.Type.DOUBLE}
+ });
+ }
+
+ public void testIndexSortDocValues() throws Exception {
+ testIndexSortDocValuesWithEvenLength(true);
+ testIndexSortDocValuesWithEvenLength(false);
+ }
+
+ private void testIndexSortDocValuesWithEvenLength(boolean reverse) throws Exception {
+ Directory dir = newDirectory();
+
+ IndexWriterConfig iwc = new IndexWriterConfig(new MockAnalyzer(random()));
+ Sort indexSort = new Sort(new SortedNumericSortField("field", type, reverse));
Review comment:
```suggestion
Sort indexSort = new Sort(new SortedNumericSortField("field", RandomPicks.randomFrom(new SortField.Type[] {SortField.Type.INT, SortField.Type.FLOAT, SortField.Type.LONG, SortField.Type.DOUBLE}), reverse));
```
##########
File path: lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestIndexSortSortedNumericDocValuesRangeQueryByType.java
##########
@@ -0,0 +1,126 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.sandbox.search;
+
+import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
+import java.util.Arrays;
+import org.apache.lucene.document.Document;
+import org.apache.lucene.document.SortedNumericDocValuesField;
+import org.apache.lucene.index.DirectoryReader;
+import org.apache.lucene.index.IndexWriterConfig;
+import org.apache.lucene.search.IndexSearcher;
+import org.apache.lucene.search.Query;
+import org.apache.lucene.search.Sort;
+import org.apache.lucene.search.SortField;
+import org.apache.lucene.search.SortedNumericSortField;
+import org.apache.lucene.store.Directory;
+import org.apache.lucene.tests.analysis.MockAnalyzer;
+import org.apache.lucene.tests.index.RandomIndexWriter;
+import org.apache.lucene.tests.util.LuceneTestCase;
+
+public class TestIndexSortSortedNumericDocValuesRangeQueryByType extends LuceneTestCase {
+ private final SortField.Type type;
+
+ public TestIndexSortSortedNumericDocValuesRangeQueryByType(SortField.Type type) {
+ this.type = type;
+ }
+
+ @ParametersFactory(argumentFormatting = "type=%s")
Review comment:
I think this is overkill.. maybe just use `RandomPicks.randomFrom(..)`?
Suggestion below.
--
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
[GitHub] [lucene] reta commented on pull request #749: LUCENE-10466: IndexSortSortedNumericDocValuesRangeQuery unconditionally assumes the usage of the LONG-encoded SortField
Posted by GitBox <gi...@apache.org>.
reta commented on pull request #749:
URL: https://github.com/apache/lucene/pull/749#issuecomment-1083295848
> To me it'd be best to only tackle the main bug you ran into, the ClassCastException when using integers. To prevent errors when using double and float values, we could add an explicit check and disable the optimization in this case, and clarify in the javadoc that only LONG and INT are supported.
@jtibshirani I was phasing out FLOAT / DOUBLE support, as per your comment, but the implementation we will end up with becomes very inconsistent and confusing, for example `SortedNumericSortField` happily deals with FLOAT / DOUBLE (see please its `SortFieldProvider` implementation https://github.com/apache/lucene/blob/main/lucene/core/src/java/org/apache/lucene/search/SortedNumericSortField.java#L109). It looks to me we either remove it from all places or consistently support it in all places, what do you think? @nknize @jpountz may be you guys could also advice?
Thank you.
--
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
[GitHub] [lucene] nknize edited a comment on pull request #749: LUCENE-10466: IndexSortSortedNumericDocValuesRangeQuery unconditionally assumes the usage of the LONG-encoded SortField
Posted by GitBox <gi...@apache.org>.
nknize edited a comment on pull request #749:
URL: https://github.com/apache/lucene/pull/749#issuecomment-1083444100
> In my opinion, long-term this IndexSortSortedNumericDocValuesRangeQuery should no longer be exposed to users. Lucene would have long/int/double/float fields ([LUCENE-10162](https://issues.apache.org/jira/browse/LUCENE-10162)) that would have factory methods to produce queries,
Does this future state assume `{Int | Long | ...}Point` and `NumericDocValuesField` will no longer be mutually exclusive?
Followup (before this merges): I'm trying to understand if we are planning to eliminate the ability for folks to index just doc values or just points when they are willing to sacrifice performance to save disk storage. Sounds punitive but there are users in this category.
Follow Followup: Exposing a setting on the new `{Int | Long | ...}Field` to index either or both (doc values, points) seems reasonable?
--
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
[GitHub] [lucene] jtibshirani commented on pull request #749: LUCENE-10466: IndexSortSortedNumericDocValuesRangeQuery unconditionally assumes the usage of the LONG-encoded SortField
Posted by GitBox <gi...@apache.org>.
jtibshirani commented on pull request #749:
URL: https://github.com/apache/lucene/pull/749#issuecomment-1082501188
Thanks! I think `NumericDocValuesField` accepts floating point types as well (see the `FloatDocValuesField` subclass for example). It is the single-valued version of `SortedNumericDocValuesField`.
--
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
[GitHub] [lucene] reta commented on pull request #749: LUCENE-10466: IndexSortSortedNumericDocValuesRangeQuery unconditionally assumes the usage of the LONG-encoded SortField
Posted by GitBox <gi...@apache.org>.
reta commented on pull request #749:
URL: https://github.com/apache/lucene/pull/749#issuecomment-1083437878
@jtibshirani comments addressed, thank you for the review!
--
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
[GitHub] [lucene] reta commented on pull request #749: LUCENE-10466: IndexSortSortedNumericDocValuesRangeQuery unconditionally assumes the usage of the LONG-encoded SortField
Posted by GitBox <gi...@apache.org>.
reta commented on pull request #749:
URL: https://github.com/apache/lucene/pull/749#issuecomment-1084917861
@jtibshirani thanks a lot for guiding me through, I believe all your comments have been addressed, thanks again!
--
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
[GitHub] [lucene] jtibshirani edited a comment on pull request #749: LUCENE-10466: IndexSortSortedNumericDocValuesRangeQuery unconditionally assumes the usage of the LONG-encoded SortField
Posted by GitBox <gi...@apache.org>.
jtibshirani edited a comment on pull request #749:
URL: https://github.com/apache/lucene/pull/749#issuecomment-1069465953
Thanks @reta! This is on my list of PRs to review, I'd just like to wait until https://github.com/apache/lucene/pull/736 wraps up as it might affect this logic a bit.
Also I noticed it targets branch_9_0 -- our usual dev workflow is for PRs to target the `main` branch. Once it's merged, the reviewer will backport and push to the release branches.
--
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
[GitHub] [lucene] jtibshirani commented on pull request #749: LUCENE-10466: IndexSortSortedNumericDocValuesRangeQuery unconditionally assumes the usage of the LONG-encoded SortField
Posted by GitBox <gi...@apache.org>.
jtibshirani commented on pull request #749:
URL: https://github.com/apache/lucene/pull/749#issuecomment-1082549529
If I'm reading the logic right, it uses a different conversion though (like `Float.floatToRawIntBits`) whereas `SortedNumericDocValuesField` expects `NumericUtils.floatToSortableInt`.
--
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
[GitHub] [lucene] jpountz commented on pull request #749: LUCENE-10466: IndexSortSortedNumericDocValuesRangeQuery unconditionally assumes the usage of the LONG-encoded SortField
Posted by GitBox <gi...@apache.org>.
jpountz commented on pull request #749:
URL: https://github.com/apache/lucene/pull/749#issuecomment-1083384716
Interestingly #687 would further specialize this query for longs by relying on the `LongPoint` encoding. cc @wjp719
> I was phasing out FLOAT / DOUBLE support, as per your comment, but the implementation we will end up with becomes very inconsistent and confusing, for example SortedNumericSortField happily deals with FLOAT / DOUBLE
Since this `IndexSortSortedNumericDocValuesRangeQuery` is in sandbox, it's totally fine if it looks a bit half-baked and only works with a small subset of the numeric types.
In my opinion, long-term this `IndexSortSortedNumericDocValuesRangeQuery` should no longer be exposed to users. Lucene would have long/int/double/float fields ([LUCENE-10162](https://issues.apache.org/jira/browse/LUCENE-10162)) that would have factory methods to produce queries, and both `IndexOrDocValuesQuery` and `IndexSortSortedNumericDocValuesRangeQuery` would become implementation details of these queries that are not exposed to users. And maybe only long and int fields would optimize for the case when they are the primary index sort, but that would be hidden from users and wouldn't affect usability.
--
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
[GitHub] [lucene] reta commented on pull request #749: LUCENE-10466: IndexSortSortedNumericDocValuesRangeQuery unconditionally assumes the usage of the LONG-encoded SortField
Posted by GitBox <gi...@apache.org>.
reta commented on pull request #749:
URL: https://github.com/apache/lucene/pull/749#issuecomment-1083423388
@jpountz thank you, sounds like everyone is on the same page, I will go ahead with the change proposed by @jtibshirani , thanks!
--
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
[GitHub] [lucene] reta commented on a change in pull request #749: LUCENE-10466: IndexSortSortedNumericDocValuesRangeQuery unconditionally assumes the usage of the LONG-encoded SortField
Posted by GitBox <gi...@apache.org>.
reta commented on a change in pull request #749:
URL: https://github.com/apache/lucene/pull/749#discussion_r840135295
##########
File path: lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestIndexSortSortedNumericDocValuesRangeQuery.java
##########
@@ -155,15 +156,23 @@ public void testToString() {
}
public void testIndexSortDocValuesWithEvenLength() throws Exception {
- testIndexSortDocValuesWithEvenLength(false);
- testIndexSortDocValuesWithEvenLength(true);
+ final SortField.Type type =
+ RandomPicks.randomFrom(
+ random(),
+ new SortField.Type[] {
+ SortField.Type.INT, SortField.Type.LONG, SortField.Type.DOUBLE, SortField.Type.FLOAT
Review comment:
> I think it'd be best to split out the DOUBLE and FLOAT checks into its own test that checks the optimization is deactivated (like testNoIndexSort)
Sure, will do that
> That way if someone breaks the query with integers, they'll know right away, instead of maybe having to run the tests a couple times before they fail!
That was initially done like that, @nknize asked me to go with `Random`, see please https://github.com/apache/lucene/pull/749#discussion_r831316035
--
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
[GitHub] [lucene] jpountz commented on pull request #749: LUCENE-10466: IndexSortSortedNumericDocValuesRangeQuery unconditionally assumes the usage of the LONG-encoded SortField
Posted by GitBox <gi...@apache.org>.
jpountz commented on pull request #749:
URL: https://github.com/apache/lucene/pull/749#issuecomment-1076562502
FYI https://github.com/apache/lucene/pull/736 is now merged.
--
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
[GitHub] [lucene] reta commented on pull request #749: LUCENE-10466: IndexSortSortedNumericDocValuesRangeQuery unconditionally assumes the usage of the LONG-encoded SortField
Posted by GitBox <gi...@apache.org>.
reta commented on pull request #749:
URL: https://github.com/apache/lucene/pull/749#issuecomment-1085853778
@jtibshirani @nknize comments addressed, thank you!
--
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
[GitHub] [lucene] jtibshirani commented on a change in pull request #749: LUCENE-10466: IndexSortSortedNumericDocValuesRangeQuery unconditionally assumes the usage of the LONG-encoded SortField
Posted by GitBox <gi...@apache.org>.
jtibshirani commented on a change in pull request #749:
URL: https://github.com/apache/lucene/pull/749#discussion_r840121029
##########
File path: lucene/sandbox/src/java/org/apache/lucene/sandbox/search/IndexSortSortedNumericDocValuesRangeQuery.java
##########
@@ -70,6 +72,9 @@
* field, lowerValue, upperValue, fallbackQuery);
* </pre>
*
+ * <b>Notes</b>: only {@code SortField.Type.LONG} and {@code SortField.Type.INT} are supported at
Review comment:
Instead we can add this as a bullet in the list above, which details what needs to be true for the optimization to apply ("This optimized execution strategy is only used if the following conditions hold...").
##########
File path: lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestIndexSortSortedNumericDocValuesRangeQuery.java
##########
@@ -155,15 +156,23 @@ public void testToString() {
}
public void testIndexSortDocValuesWithEvenLength() throws Exception {
- testIndexSortDocValuesWithEvenLength(false);
- testIndexSortDocValuesWithEvenLength(true);
+ final SortField.Type type =
+ RandomPicks.randomFrom(
+ random(),
+ new SortField.Type[] {
+ SortField.Type.INT, SortField.Type.LONG, SortField.Type.DOUBLE, SortField.Type.FLOAT
Review comment:
I think it'd be best to split out the `DOUBLE` and `FLOAT` checks into its own test that checks the optimization is deactivated (like `testNoIndexSort`). Also I think it's nice to improve coverage by doing
```
for (SortField.Type type : new new SortField.Type[] { SortField.Type.INT, SortField.Type.LONG}) {
...
}
```
That way if someone breaks the query with integers, they'll know right away, instead of maybe having to run the tests a couple times before they fail!
##########
File path: lucene/sandbox/src/java/org/apache/lucene/sandbox/search/IndexSortSortedNumericDocValuesRangeQuery.java
##########
@@ -250,6 +255,10 @@ private BoundedDocIdSetIterator getDocIdSetIterator(
// Perform a binary search to find the first document with value >= lower.
ValueComparator comparator = loadComparator(sortField, lower, context);
+ if (comparator == null) {
Review comment:
I find this harder to follow than if we checked up front in `getDocIdSetIteratorOrNull`. If we did that, we wouldn't have to pipe the `null` return value around here. We could then even simplify the check inside `loadComparator`, because we would know that `SortField.Type` is either `INT` or `LONG`.
--
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
[GitHub] [lucene] nknize commented on pull request #749: LUCENE-10466: IndexSortSortedNumericDocValuesRangeQuery unconditionally assumes the usage of the LONG-encoded SortField
Posted by GitBox <gi...@apache.org>.
nknize commented on pull request #749:
URL: https://github.com/apache/lucene/pull/749#issuecomment-1083444100
> In my opinion, long-term this IndexSortSortedNumericDocValuesRangeQuery should no longer be exposed to users. Lucene would have long/int/double/float fields ([LUCENE-10162](https://issues.apache.org/jira/browse/LUCENE-10162)) that would have factory methods to produce queries,
Does this future state assume `{Int | Long | ...}Point` and `NumericDocValuesField` will no longer be mutually exclusive?
--
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
[GitHub] [lucene] reta commented on pull request #749: LUCENE-10466: IndexSortSortedNumericDocValuesRangeQuery unconditionally assumes the usage of the LONG-encoded SortField
Posted by GitBox <gi...@apache.org>.
reta commented on pull request #749:
URL: https://github.com/apache/lucene/pull/749#issuecomment-1068292093
@jtibshirani would very appreciate your feedback on the fix, I have tried to go wild with typed approach (typed sorted ranges / doc values for int/long/double/float) but went down to the rabbit hole up to `NumericDocValues` which operates on `long` only. Thank you.
--
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
[GitHub] [lucene] reta commented on pull request #749: LUCENE-10466: IndexSortSortedNumericDocValuesRangeQuery unconditionally assumes the usage of the LONG-encoded SortField
Posted by GitBox <gi...@apache.org>.
reta commented on pull request #749:
URL: https://github.com/apache/lucene/pull/749#issuecomment-1069493698
Thanks a lot @jtibshirani , I will re-target the `main`
--
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
[GitHub] [lucene] reta commented on a change in pull request #749: LUCENE-10466: IndexSortSortedNumericDocValuesRangeQuery unconditionally assumes the usage of the LONG-encoded SortField
Posted by GitBox <gi...@apache.org>.
reta commented on a change in pull request #749:
URL: https://github.com/apache/lucene/pull/749#discussion_r840135696
##########
File path: lucene/sandbox/src/java/org/apache/lucene/sandbox/search/IndexSortSortedNumericDocValuesRangeQuery.java
##########
@@ -250,6 +255,10 @@ private BoundedDocIdSetIterator getDocIdSetIterator(
// Perform a binary search to find the first document with value >= lower.
ValueComparator comparator = loadComparator(sortField, lower, context);
+ if (comparator == null) {
Review comment:
👍
##########
File path: lucene/sandbox/src/java/org/apache/lucene/sandbox/search/IndexSortSortedNumericDocValuesRangeQuery.java
##########
@@ -70,6 +72,9 @@
* field, lowerValue, upperValue, fallbackQuery);
* </pre>
*
+ * <b>Notes</b>: only {@code SortField.Type.LONG} and {@code SortField.Type.INT} are supported at
Review comment:
👍
--
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
[GitHub] [lucene] nknize edited a comment on pull request #749: LUCENE-10466: IndexSortSortedNumericDocValuesRangeQuery unconditionally assumes the usage of the LONG-encoded SortField
Posted by GitBox <gi...@apache.org>.
nknize edited a comment on pull request #749:
URL: https://github.com/apache/lucene/pull/749#issuecomment-1083444100
> In my opinion, long-term this IndexSortSortedNumericDocValuesRangeQuery should no longer be exposed to users. Lucene would have long/int/double/float fields ([LUCENE-10162](https://issues.apache.org/jira/browse/LUCENE-10162)) that would have factory methods to produce queries,
Does this future state assume `{Int | Long | ...}Point` and `NumericDocValuesField` will no longer be mutually exclusive?
Followup (before this merges): I'm trying to understand if we are planning to eliminate the ability for folks to index just doc values or just points when they are willing to sacrifice performance to save disk storage. Sounds punitive but there are users in this category.
--
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
[GitHub] [lucene] nknize commented on a change in pull request #749: LUCENE-10466: IndexSortSortedNumericDocValuesRangeQuery unconditionally assumes the usage of the LONG-encoded SortField
Posted by GitBox <gi...@apache.org>.
nknize commented on a change in pull request #749:
URL: https://github.com/apache/lucene/pull/749#discussion_r840219946
##########
File path: lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestIndexSortSortedNumericDocValuesRangeQuery.java
##########
@@ -155,15 +156,23 @@ public void testToString() {
}
public void testIndexSortDocValuesWithEvenLength() throws Exception {
- testIndexSortDocValuesWithEvenLength(false);
- testIndexSortDocValuesWithEvenLength(true);
+ final SortField.Type type =
+ RandomPicks.randomFrom(
+ random(),
+ new SortField.Type[] {
+ SortField.Type.INT, SortField.Type.LONG, SortField.Type.DOUBLE, SortField.Type.FLOAT
Review comment:
RandomPicks was suggested to avoid the original java annotation approach. I like @jtibshirani idea of explicitly testing through the foreach...
--
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
[GitHub] [lucene] reta commented on a change in pull request #749: LUCENE-10466: IndexSortSortedNumericDocValuesRangeQuery unconditionally assumes the usage of the LONG-encoded SortField
Posted by GitBox <gi...@apache.org>.
reta commented on a change in pull request #749:
URL: https://github.com/apache/lucene/pull/749#discussion_r831340155
##########
File path: lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestIndexSortSortedNumericDocValuesRangeQueryByType.java
##########
@@ -0,0 +1,126 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.sandbox.search;
+
+import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
+import java.util.Arrays;
+import org.apache.lucene.document.Document;
+import org.apache.lucene.document.SortedNumericDocValuesField;
+import org.apache.lucene.index.DirectoryReader;
+import org.apache.lucene.index.IndexWriterConfig;
+import org.apache.lucene.search.IndexSearcher;
+import org.apache.lucene.search.Query;
+import org.apache.lucene.search.Sort;
+import org.apache.lucene.search.SortField;
+import org.apache.lucene.search.SortedNumericSortField;
+import org.apache.lucene.store.Directory;
+import org.apache.lucene.tests.analysis.MockAnalyzer;
+import org.apache.lucene.tests.index.RandomIndexWriter;
+import org.apache.lucene.tests.util.LuceneTestCase;
+
+public class TestIndexSortSortedNumericDocValuesRangeQueryByType extends LuceneTestCase {
+ private final SortField.Type type;
+
+ public TestIndexSortSortedNumericDocValuesRangeQueryByType(SortField.Type type) {
+ this.type = type;
+ }
+
+ @ParametersFactory(argumentFormatting = "type=%s")
+ public static Iterable<Object[]> parametersWithCustomName() {
+ return Arrays.asList(
+ new Object[][] {
+ {SortField.Type.INT},
+ {SortField.Type.FLOAT},
+ {SortField.Type.LONG},
+ {SortField.Type.DOUBLE}
+ });
+ }
+
+ public void testIndexSortDocValues() throws Exception {
+ testIndexSortDocValuesWithEvenLength(true);
+ testIndexSortDocValuesWithEvenLength(false);
+ }
+
+ private void testIndexSortDocValuesWithEvenLength(boolean reverse) throws Exception {
+ Directory dir = newDirectory();
+
+ IndexWriterConfig iwc = new IndexWriterConfig(new MockAnalyzer(random()));
+ Sort indexSort = new Sort(new SortedNumericSortField("field", type, reverse));
Review comment:
:+1: , done, thanks @nknize !
##########
File path: lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestIndexSortSortedNumericDocValuesRangeQueryByType.java
##########
@@ -0,0 +1,126 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.sandbox.search;
+
+import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
+import java.util.Arrays;
+import org.apache.lucene.document.Document;
+import org.apache.lucene.document.SortedNumericDocValuesField;
+import org.apache.lucene.index.DirectoryReader;
+import org.apache.lucene.index.IndexWriterConfig;
+import org.apache.lucene.search.IndexSearcher;
+import org.apache.lucene.search.Query;
+import org.apache.lucene.search.Sort;
+import org.apache.lucene.search.SortField;
+import org.apache.lucene.search.SortedNumericSortField;
+import org.apache.lucene.store.Directory;
+import org.apache.lucene.tests.analysis.MockAnalyzer;
+import org.apache.lucene.tests.index.RandomIndexWriter;
+import org.apache.lucene.tests.util.LuceneTestCase;
+
+public class TestIndexSortSortedNumericDocValuesRangeQueryByType extends LuceneTestCase {
+ private final SortField.Type type;
+
+ public TestIndexSortSortedNumericDocValuesRangeQueryByType(SortField.Type type) {
+ this.type = type;
+ }
+
+ @ParametersFactory(argumentFormatting = "type=%s")
Review comment:
:+1:
--
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
[GitHub] [lucene] jtibshirani commented on a change in pull request #749: LUCENE-10466: IndexSortSortedNumericDocValuesRangeQuery unconditionally assumes the usage of the LONG-encoded SortField
Posted by GitBox <gi...@apache.org>.
jtibshirani commented on a change in pull request #749:
URL: https://github.com/apache/lucene/pull/749#discussion_r839809386
##########
File path: lucene/core/src/java/org/apache/lucene/search/SortedNumericSortField.java
##########
@@ -62,7 +62,9 @@ public SortedNumericSortField(String field, SortField.Type type) {
}
/**
- * Creates a sort, possibly in reverse, by the minimum value in the set for the document.
+ * Creates a sort, possibly in reverse, by the minimum value in the set for the document. Please
Review comment:
I don't think we should restrict what's supported here. I was only thinking we'd what sort types we apply the optimization for in `IndexSortSortedNumericDocValuesRangeQuery`, not make any restrictions for sorting in general.
So we could move this comment about the sort types it can handle to `IndexSortSortedNumericDocValuesRangeQuery`.
##########
File path: lucene/CHANGES.txt
##########
@@ -39,7 +39,9 @@ Optimizations
Bug Fixes
---------------------
-(No changes)
+
+* LUCENE-10466: IndexSortSortedNumericDocValuesRangeQuery unconditionally
Review comment:
Small comment, in the changelog we usually describe what the change does, as opposed to the bug statement (like "Ensure IndexSortSortedNumericDocValuesRangeQuery handles sort field types besides LONG")
##########
File path: lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestIndexSortSortedNumericDocValuesRangeQueryByType.java
##########
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.sandbox.search;
+
+import com.carrotsearch.randomizedtesting.generators.RandomPicks;
+import org.apache.lucene.document.Document;
+import org.apache.lucene.document.SortedNumericDocValuesField;
+import org.apache.lucene.index.DirectoryReader;
+import org.apache.lucene.index.IndexWriterConfig;
+import org.apache.lucene.search.IndexSearcher;
+import org.apache.lucene.search.Query;
+import org.apache.lucene.search.Sort;
+import org.apache.lucene.search.SortField;
+import org.apache.lucene.search.SortedNumericSortField;
+import org.apache.lucene.store.Directory;
+import org.apache.lucene.tests.analysis.MockAnalyzer;
+import org.apache.lucene.tests.index.RandomIndexWriter;
+import org.apache.lucene.tests.util.LuceneTestCase;
+
+public class TestIndexSortSortedNumericDocValuesRangeQueryByType extends LuceneTestCase {
Review comment:
It'd be good to fold these tests into `IndexSortSortedNumericDocValuesRangeQuery` so we just have one place where this query is tested.
##########
File path: lucene/sandbox/src/java/org/apache/lucene/sandbox/search/IndexSortSortedNumericDocValuesRangeQuery.java
##########
@@ -318,6 +326,17 @@ private static ValueComparator loadComparator(
};
}
+ private static Number convert(Type type, long topValue) {
+ if (type == Type.INT) {
+ return (int) topValue;
+ } else if (type == Type.LONG) {
+ return topValue;
+ } else {
+ throw new IllegalArgumentException(
Review comment:
When it can't apply the optimization, this query just skips the optimization instead of throwing an exception (see `getDocIdSetIteratorOrNull`, where it returns a null iterator when the index sort doesn't match). I think we should also check the sort field type there and disable the optimization in that case.
--
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
[GitHub] [lucene] reta commented on a change in pull request #749: LUCENE-10466: IndexSortSortedNumericDocValuesRangeQuery unconditionally assumes the usage of the LONG-encoded SortField
Posted by GitBox <gi...@apache.org>.
reta commented on a change in pull request #749:
URL: https://github.com/apache/lucene/pull/749#discussion_r840528970
##########
File path: lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestIndexSortSortedNumericDocValuesRangeQuery.java
##########
@@ -155,15 +156,23 @@ public void testToString() {
}
public void testIndexSortDocValuesWithEvenLength() throws Exception {
- testIndexSortDocValuesWithEvenLength(false);
- testIndexSortDocValuesWithEvenLength(true);
+ final SortField.Type type =
+ RandomPicks.randomFrom(
+ random(),
+ new SortField.Type[] {
+ SortField.Type.INT, SortField.Type.LONG, SortField.Type.DOUBLE, SortField.Type.FLOAT
Review comment:
@nknize noted, thank you!
--
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