Description
PointInSetQuery in its constructor will check if the values provided to it are in order and if not will attempt to throw an exception:
throw new IllegalArgumentException(
"values are out of order: saw " + previous + " before " + current);
However instead of this exception, the following exception is thrown:
java.lang.UnsupportedOperationException
at org.apache.lucene.util.BytesRefBuilder.hashCode(BytesRefBuilder.java:172)
at java.base/java.lang.Object.toString(Object.java:256)
at java.base/java.lang.StringConcatHelper.stringOf(StringConcatHelper.java:453)
at org.apache.lucene.search.PointInSetQuery.<init>(PointInSetQuery.java:116)
This is because previous is a BytesRefBuilder which does not support the hashCode() method which is used by the default toString() method.
Either BytesRefBuilder should be updated to allow for toString() to be invoked on it or the code should be modified to retrieve the BytesRef within the BytesRefBuilder so that the correct exception is thrown
Version and environment details