public class DocValuesNumbersQuery extends Query implements Accountable
DocValuesTermsQuery
, but this query only
runs on a long NumericDocValuesField
or a
SortedNumericDocValuesField
, matching
all documents whose value in the specified field is
contained in the provided set of long values.
NOTE: be very careful using this query: it is
typically much slower than using TermsQuery
,
but in certain specialized cases may be faster.
Constructor and Description |
---|
DocValuesNumbersQuery(String field,
Collection<Long> numbers) |
DocValuesNumbersQuery(String field,
Long... numbers) |
DocValuesNumbersQuery(String field,
long[] numbers) |
Modifier and Type | Method and Description |
---|---|
Weight |
createWeight(IndexSearcher searcher,
ScoreMode scoreMode,
float boost)
Expert: Constructs an appropriate Weight implementation for this query.
|
boolean |
equals(Object other)
Override and implement query instance equivalence properly in a subclass.
|
String |
getField() |
Set<Long> |
getNumbers() |
int |
hashCode()
Override and implement query hash code properly in a subclass.
|
long |
ramBytesUsed()
Return the memory usage of this object in bytes.
|
String |
toString(String defaultField)
Prints a query to a string, with
field assumed to be the
default field and omitted. |
void |
visit(QueryVisitor visitor)
Recurse through the query tree, visiting any child queries
|
classHash, rewrite, sameClassAs, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getChildResources
public DocValuesNumbersQuery(String field, long[] numbers)
public DocValuesNumbersQuery(String field, Collection<Long> numbers)
public boolean equals(Object other)
Query
QueryCache
works properly.
Typically a query will be equal to another only if it's an instance of
the same class and its document-filtering properties are identical that other
instance. Utility methods are provided for certain repetitive code.equals
in class Query
Query.sameClassAs(Object)
,
Query.classHash()
public int hashCode()
Query
QueryCache
works properly.hashCode
in class Query
Query.equals(Object)
public void visit(QueryVisitor visitor)
Query
public String getField()
public String toString(String defaultField)
Query
field
assumed to be the
default field and omitted.public long ramBytesUsed()
Accountable
ramBytesUsed
in interface Accountable
public Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost) throws IOException
Query
Only implemented by primitive queries, which re-write to themselves.
createWeight
in class Query
scoreMode
- How the produced scorers will be consumed.boost
- The boost that is propagated by the parent queries.IOException
Copyright © 2000–2020 The Apache Software Foundation. All rights reserved.