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 SearchPredicate
build()
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
toPredicate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.hibernate.search.engine.search.predicate.dsl.KnnPredicateOptionsStep
filter
Methods 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:KnnPredicateFieldStep
Target the given field in the match predicate.- Specified by:
field
in 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:
build
in classAbstractPredicateFinalStep
-
filter
- Specified by:
filter
in interfaceKnnPredicateOptionsStep
-
filter
public KnnPredicateOptionsStep filter(Function<? super SearchPredicateFactory, ? extends PredicateFinalStep> clauseContributor) - Specified by:
filter
in interfaceKnnPredicateOptionsStep
-
matching
- Specified by:
matching
in 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:
matching
in 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:
requiredMinimumSimilarity
in 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:PredicateScoreStep
Boost the weight of the predicate in score computation.- Specified by:
boost
in 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:PredicateScoreStep
Force 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:
constantScore
in interfacePredicateScoreStep<KnnPredicateOptionsStep>
- Returns:
this
, for method chaining.
-