Class SearchRequest
java.lang.Object
org.springframework.ai.vectorstore.SearchRequest
Similarity search request. Use the
builder()
to create the
instance of a SearchRequest
.- Author:
- Christian Tzolov, Thomas Vitale, Ilayaperumal Gopinathan
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Default value for the top 'k' similar results to return.static final double
Similarity threshold that accepts all search scores. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic SearchRequest.Builder
builder()
Builder for creating the SearchRequest instance.boolean
static SearchRequest.Builder
from
(SearchRequest originalSearchRequest) Copy an existingSearchRequest.Builder
instance.getQuery()
double
int
getTopK()
boolean
int
hashCode()
toString()
-
Field Details
-
SIMILARITY_THRESHOLD_ACCEPT_ALL
public static final double SIMILARITY_THRESHOLD_ACCEPT_ALLSimilarity threshold that accepts all search scores. A threshold value of 0.0 means any similarity is accepted or disable the similarity threshold filtering. A threshold value of 1.0 means an exact match is required.- See Also:
-
DEFAULT_TOP_K
public static final int DEFAULT_TOP_KDefault value for the top 'k' similar results to return.- See Also:
-
-
Constructor Details
-
SearchRequest
public SearchRequest()
-
-
Method Details
-
from
Copy an existingSearchRequest.Builder
instance.- Parameters:
originalSearchRequest
-SearchRequest
instance to copy.- Returns:
- Returns new
SearchRequest.Builder
instance.
-
getQuery
-
getTopK
public int getTopK() -
getSimilarityThreshold
public double getSimilarityThreshold() -
getFilterExpression
-
hasFilterExpression
public boolean hasFilterExpression() -
toString
-
equals
-
hashCode
public int hashCode() -
builder
Builder for creating the SearchRequest instance.- Returns:
- the builder.
-