Package org.apache.lucene.search
Class ByteVectorSimilarityQuery.Explicit
java.lang.Object
org.apache.lucene.search.Query
org.apache.lucene.search.ByteVectorSimilarityQuery
org.apache.lucene.search.ByteVectorSimilarityQuery.Explicit
- Enclosing class:
ByteVectorSimilarityQuery
@Deprecated
public static non-sealed class ByteVectorSimilarityQuery.Explicit
extends ByteVectorSimilarityQuery
Deprecated.
A
ByteVectorSimilarityQuery with an explicit threshold for graph traversal.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.search.ByteVectorSimilarityQuery
ByteVectorSimilarityQuery.Adaptive, ByteVectorSimilarityQuery.Explicit -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final floatprotected final Stringprotected final Queryprotected final floatprotected final KnnSearchStrategy -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Search for all (approximate) byte vectors above a similarity threshold usingExplicitVectorSimilarityCollector.Deprecated.Search for all (approximate) byte vectors above a similarity threshold usingExplicitVectorSimilarityCollector.Explicit(String field, byte[] target, float traversalSimilarity, float resultSimilarity, Query filter) Deprecated.Search for all (approximate) byte vectors above a similarity threshold usingExplicitVectorSimilarityCollector.Deprecated.Search for all (approximate) byte vectors above a similarity threshold usingExplicitVectorSimilarityCollector. -
Method Summary
Modifier and TypeMethodDescriptioncreateWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost) Expert: Constructs an appropriate Weight implementation for this query.booleanDeprecated.Override and implement query instance equivalence properly in a subclass.protected KnnCollectorManagerDeprecated.Returns aKnnCollectorManagerthat always builds aVectorSimilarityCollectorconfigured with this query'ssearchStrategy.inthashCode()Deprecated.Override and implement query hash code properly in a subclass.Deprecated.Prints a query to a string, withfieldassumed to be the default field and omitted.voidvisit(QueryVisitor visitor) Recurse through the query tree, visiting any child queries.Methods inherited from class org.apache.lucene.search.ByteVectorSimilarityQuery
approximateSearchMethods inherited from class org.apache.lucene.search.Query
classHash, rewrite, sameClassAs, toString
-
Field Details
-
field
-
resultSimilarity
protected final float resultSimilarity -
decay
protected final float decay -
filter
-
searchStrategy
-
-
Constructor Details
-
Explicit
public Explicit(String field, byte[] target, float traversalSimilarity, float resultSimilarity, Query filter) Deprecated.Search for all (approximate) byte vectors above a similarity threshold usingExplicitVectorSimilarityCollector. If a filter is applied, it traverses as many nodes as the cost of the filter, and then falls back to exact search if results are incomplete.- Parameters:
field- a field that has been indexed as aKnnByteVectorField.target- the target of the search.traversalSimilarity- (lower) similarity score for graph traversal.resultSimilarity- (higher) similarity score for result collection.filter- a filter applied before the vector search.
-
Explicit
Deprecated.Search for all (approximate) byte vectors above a similarity threshold usingExplicitVectorSimilarityCollector.- Parameters:
field- a field that has been indexed as aKnnByteVectorField.target- the target of the search.traversalSimilarity- (lower) similarity score for graph traversal.resultSimilarity- (higher) similarity score for result collection.
-
Explicit
Deprecated.Search for all (approximate) byte vectors above a similarity threshold usingExplicitVectorSimilarityCollector. If a filter is applied, it traverses as many nodes as the cost of the filter, and then falls back to exact search if results are incomplete.- Parameters:
field- a field that has been indexed as aKnnByteVectorField.target- the target of the search.resultSimilarity- similarity score for result collection.filter- a filter applied before the vector search.
-
Explicit
Deprecated.Search for all (approximate) byte vectors above a similarity threshold usingExplicitVectorSimilarityCollector.- Parameters:
field- a field that has been indexed as aKnnByteVectorField.target- the target of the search.resultSimilarity- similarity score for result collection.
-
-
Method Details
-
getKnnCollectorManager
Deprecated.Returns aKnnCollectorManagerthat always builds aVectorSimilarityCollectorconfigured with this query'ssearchStrategy.The manager's
strategyandLeafReaderContextparameters are intentionally ignored: top-k queries may override the strategy on a per-search basis, but similarity- threshold queries pin the strategy to the query's own value at construction time so thatQuery.equals(java.lang.Object)/getSearchStrategy()remain a faithful description of search behavior. -
toString
Deprecated.Description copied from class:QueryPrints a query to a string, withfieldassumed to be the default field and omitted. -
equals
Deprecated.Description copied from class:QueryOverride and implement query instance equivalence properly in a subclass. This is required so thatQueryCacheworks 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 to those of the other instance. Utility methods are provided for certain repetitive code.
- Overrides:
equalsin classByteVectorSimilarityQuery- See Also:
-
hashCode
public int hashCode()Deprecated.Description copied from class:QueryOverride and implement query hash code properly in a subclass. This is required so thatQueryCacheworks properly.- Overrides:
hashCodein classByteVectorSimilarityQuery- See Also:
-
getSearchStrategy
- Returns:
- the
KnnSearchStrategyused during graph search.
-
createWeight
public Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost) throws IOException Description copied from class:QueryExpert: Constructs an appropriate Weight implementation for this query.Only implemented by primitive queries, which re-write to themselves.
- Overrides:
createWeightin classQuery- Parameters:
scoreMode- How the produced scorers will be consumed.boost- The boost that is propagated by the parent queries.- Throws:
IOException
-
visit
Description copied from class:QueryRecurse through the query tree, visiting any child queries.
-
ByteVectorSimilarityQueryconstructors in Lucene 10.4 and earlier, useByteVectorSimilarityQuery.Adaptivefor a more performant version.