Fluent builder for assembling the SearchParameters used to run a vector search. Obtained from VectorSearchManager.searchParametersBuilder, populated with the search terms, paging and highlighting options, and finished with build to produce the immutable SearchParameters passed to VectorSearchManager.search.
Group: Builders
Methods
concepts(String concept)
Returns: SearchParametersBuilder
Adds one or more search terms, creating the underlying list on first use. Terms are joined together and used both for keyword matching and to generate the query's embedding vector.
| Parameter | Description |
|---|---|
concept | the search terms to add |
concepts(Collection<String> contept)
Returns: SearchParametersBuilder
Adds a collection of search terms, creating the underlying list on first use. Terms are joined together and used both for keyword matching and to generate the query's embedding vector.
| Parameter | Description |
|---|---|
contept | the search terms to add |
limit(Integer limit)
Returns: SearchParametersBuilder
Sets the maximum number of results to return. Treated as one if null or less than one.
| Parameter | Description |
|---|---|
limit | the maximum number of results |
offset(Integer offset)
Returns: SearchParametersBuilder
Sets the number of leading results to skip, for paging through matches. Ignored if null or not greater than zero.
| Parameter | Description |
|---|---|
offset | the paging offset |
score(Float score)
Returns: SearchParametersBuilder
Sets the minimum relevance score a result must have to be included. Results are unrestricted by score if null.
| Parameter | Description |
|---|---|
score | the minimum score |
fragmentSize(Integer fragmentSize)
Returns: SearchParametersBuilder
Sets the maximum length, in characters, of each highlighted content fragment. Defaults to 1000 if null.
| Parameter | Description |
|---|---|
fragmentSize | the highlight fragment size |
fragmentCount(Integer fragmentCount)
Returns: SearchParametersBuilder
Sets the maximum number of highlighted content fragments to return per matching document. Defaults to 3 if null.
| Parameter | Description |
|---|---|
fragmentCount | the highlight fragment count |
build()
Returns: SearchParameters
Builds the immutable SearchParameters from the fields set on this builder, ready to be passed to VectorSearchManager.search.