Class KnnPredicateFieldStepImpl
java.lang.Object
org.hibernate.search.engine.search.predicate.dsl.spi.AbstractPredicateFinalStep
org.hibernate.search.engine.search.predicate.dsl.spi.KnnPredicateFieldStepImpl
- All Implemented Interfaces:
KnnPredicateFieldStep,KnnPredicateOptionsStep,KnnPredicateVectorStep,PredicateFinalStep,PredicateScoreStep<KnnPredicateOptionsStep>
public class KnnPredicateFieldStepImpl
extends AbstractPredicateFinalStep
implements KnnPredicateFieldStep, KnnPredicateVectorStep, KnnPredicateOptionsStep
-
Field Summary
FieldsFields inherited from class org.hibernate.search.engine.search.predicate.dsl.spi.AbstractPredicateFinalStep
dslContext -
Constructor Summary
ConstructorsConstructorDescriptionKnnPredicateFieldStepImpl(SearchPredicateFactory factory, SearchPredicateDslContext<?> dslContext, int k) -
Method Summary
Modifier and TypeMethodDescriptionboost(float boost) Boost the weight of the predicate in score computation.protected SearchPredicatebuild()Force the score of the predicate to a single constant, identical for all documents.Target the given field in the match predicate.filter(Function<? super SearchPredicateFactory, ? extends PredicateFinalStep> clauseContributor) filter(SearchPredicate searchPredicate) matching(byte... vector) matching(float... vector) requiredMinimumSimilarity(float similarity) Methods inherited from class org.hibernate.search.engine.search.predicate.dsl.spi.AbstractPredicateFinalStep
toPredicateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.hibernate.search.engine.search.predicate.dsl.KnnPredicateOptionsStep
filterMethods inherited from interface org.hibernate.search.engine.search.predicate.dsl.PredicateFinalStep
toPredicate
-
Field Details
-
builder
-
-
Constructor Details
-
KnnPredicateFieldStepImpl
public KnnPredicateFieldStepImpl(SearchPredicateFactory factory, SearchPredicateDslContext<?> dslContext, int k)
-
-
Method Details
-
field
Description copied from interface:KnnPredicateFieldStepTarget the given field in the match predicate.- Specified by:
fieldin interfaceKnnPredicateFieldStep- Parameters:
fieldPath- The path to the index field to apply the predicate on.- Returns:
- The next step in the knn predicate DSL.
-
build
- Specified by:
buildin classAbstractPredicateFinalStep
-
filter
- Specified by:
filterin interfaceKnnPredicateOptionsStep
-
filter
public KnnPredicateOptionsStep filter(Function<? super SearchPredicateFactory, ? extends PredicateFinalStep> clauseContributor) - Specified by:
filterin interfaceKnnPredicateOptionsStep
-
matching
- Specified by:
matchingin interfaceKnnPredicateVectorStep- Parameters:
vector- The vector from which to compute the distance to vectors in the indexed field.- Returns:
- The next step in the knn predicate DSL.
-
matching
- Specified by:
matchingin interfaceKnnPredicateVectorStep- Parameters:
vector- The vector from which to compute the distance to vectors in the indexed field.- Returns:
- The next step in the knn predicate DSL.
-
requiredMinimumSimilarity
- Specified by:
requiredMinimumSimilarityin interfaceKnnPredicateOptionsStep- Parameters:
similarity- A similarity limit: documents with vectors distance to which, according to the configured similarity function, is further than this limit will be filtered out from the results.- Returns:
this, for method chaining.
-
boost
Description copied from interface:PredicateScoreStepBoost the weight of the predicate in score computation.- Specified by:
boostin interfacePredicateScoreStep<KnnPredicateOptionsStep>- Parameters:
boost- The boost factor. Higher than 1 increases the weight in score computation, between 0 and 1 lowers the weight. Lower than 0 is for experts only.- Returns:
this, for method chaining.
-
constantScore
Description copied from interface:PredicateScoreStepForce the score of the predicate to a single constant, identical for all documents.By default, the score will be
1.0f, butboosts, if any, will still be applied to the predicate.- Specified by:
constantScorein interfacePredicateScoreStep<KnnPredicateOptionsStep>- Returns:
this, for method chaining.
-