mirror of
https://github.com/apache/lucene.git
synced 2025-03-06 08:19:23 +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).
|
||||
Edge tree is now just a tree of edges. (Ignacio Vera)
|
||||
|
||||
* LUCENE-9046: Fix wrong example in Javadoc of TermInSetQuery (Namgyu Kim)
|
||||
|
||||
Build
|
||||
|
||||
* 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}
|
||||
* would yield the same scores:
|
||||
* <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();
|
||||
* 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.
|
||||
*/
|
||||
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
|
||||
boolean sorted = terms instanceof SortedSet && ((SortedSet<BytesRef>)terms).comparator() == null;
|
||||
if (!sorted) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user