mirror of
https://github.com/apache/lucene.git
synced 2025-03-06 16:29:30 +00:00
LUCENE-9046: Fix wrong example in Javadoc of TermInSetQuery
Signed-off-by: Namgyu Kim <namgyu@apache.org>
This commit is contained in:
parent
805305c410
commit
d1163450b6
@ -127,6 +127,8 @@ Other
|
|||||||
* LUCENE-8746: Refactor EdgeTree - Introduce a Component tree that represents the tree of components (e.g polygons).
|
* LUCENE-8746: Refactor EdgeTree - Introduce a Component tree that represents the tree of components (e.g polygons).
|
||||||
Edge tree is now just a tree of edges. (Ignacio Vera)
|
Edge tree is now just a tree of edges. (Ignacio Vera)
|
||||||
|
|
||||||
|
* LUCENE-9046: Fix wrong example in Javadoc of TermInSetQuery (Namgyu Kim)
|
||||||
|
|
||||||
Build
|
Build
|
||||||
|
|
||||||
* Upgrade forbiddenapis to version 2.7; upgrade Groovy to 2.4.17. (Uwe Schindler)
|
* Upgrade forbiddenapis to version 2.7; upgrade Groovy to 2.4.17. (Uwe Schindler)
|
||||||
|
@ -51,7 +51,7 @@ import org.apache.lucene.util.RamUsageEstimator;
|
|||||||
* <p>For instance in the following example, both {@code q1} and {@code q2}
|
* <p>For instance in the following example, both {@code q1} and {@code q2}
|
||||||
* would yield the same scores:
|
* would yield the same scores:
|
||||||
* <pre class="prettyprint">
|
* <pre class="prettyprint">
|
||||||
* Query q1 = new TermInSetQuery(new Term("field", "foo"), new Term("field", "bar"));
|
* Query q1 = new TermInSetQuery("field", new BytesRef("foo"), new BytesRef("bar"));
|
||||||
*
|
*
|
||||||
* BooleanQuery bq = new BooleanQuery();
|
* BooleanQuery bq = new BooleanQuery();
|
||||||
* bq.add(new TermQuery(new Term("field", "foo")), Occur.SHOULD);
|
* bq.add(new TermQuery(new Term("field", "foo")), Occur.SHOULD);
|
||||||
@ -78,7 +78,7 @@ public class TermInSetQuery extends Query implements Accountable {
|
|||||||
* Creates a new {@link TermInSetQuery} from the given collection of terms.
|
* Creates a new {@link TermInSetQuery} from the given collection of terms.
|
||||||
*/
|
*/
|
||||||
public TermInSetQuery(String field, Collection<BytesRef> terms) {
|
public TermInSetQuery(String field, Collection<BytesRef> terms) {
|
||||||
BytesRef[] sortedTerms = terms.toArray(new BytesRef[terms.size()]);
|
BytesRef[] sortedTerms = terms.toArray(new BytesRef[0]);
|
||||||
// already sorted if we are a SortedSet with natural order
|
// already sorted if we are a SortedSet with natural order
|
||||||
boolean sorted = terms instanceof SortedSet && ((SortedSet<BytesRef>)terms).comparator() == null;
|
boolean sorted = terms instanceof SortedSet && ((SortedSet<BytesRef>)terms).comparator() == null;
|
||||||
if (!sorted) {
|
if (!sorted) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user