All Products
Search
Document Center

OpenSearch:SearchParams class

Last Updated:Apr 01, 2026

SearchParams builds a search request for Open Search. Use it to set a query keyword, apply filters, configure ranking and sorting, add aggregations, and control other search behaviors — then pass the assembled object to the search API.

Constructors

SignatureDescription
SearchParams(Config config)Initializes with a Config object.
SearchParams()Initializes with no parameters.

Methods

Setters

setQuery

SearchParams setQuery(String query)

Sets the query keyword for full-text search.

ParameterTypeDescription
queryStringThe query keyword.

setFilter

SearchParams setFilter(String filter)

Sets the filter condition to narrow search results.

ParameterTypeDescription
filterStringThe filter condition.

setSuggest

SearchParams setSuggest(Suggest suggest)

Sets a Suggest object as a query parameter.

ParameterTypeDescription
suggestSuggestThe Suggest object.

setConfig

SearchParams setConfig(Config config)

Sets a Config object as a query parameter.

ParameterTypeDescription
configConfigThe Config object.

setQueryProcessorNames

SearchParams setQueryProcessorNames(List<String> queryProcessorNames)

Sets the full list of query analyzers.

ParameterTypeDescription
queryProcessorNamesList<String>The list of query analyzers.
To add query analyzers one at a time instead of replacing the list, use addToQueryProcessorNames.

setAggregates

SearchParams setAggregates(Set<Aggregate> aggreates)

Sets the full collection of Aggregate objects.

ParameterTypeDescription
aggreatesSet<Aggregate>The set of Aggregate objects.
To add Aggregate objects one at a time instead of replacing the collection, use addToAggregates.

setDistincts

SearchParams setDistincts(Set<Distinct> distincts)

Sets the full collection of Distinct objects.

ParameterTypeDescription
distinctsSet<Distinct>The set of Distinct objects.
To add Distinct objects one at a time instead of replacing the collection, use addToDistincts.

setRank

SearchParams setRank(Rank rank)

Sets a Rank object as a query parameter.

ParameterTypeDescription
rankRankThe Rank object.

setSort

SearchParams setSort(Sort sort)

Sets a Sort object as a query parameter.

ParameterTypeDescription
sortSortThe Sort object.

setSummaries

SearchParams setSummaries(Set<Summary> summaries)

Sets the full collection of Summary objects.

ParameterTypeDescription
summariesSet<Summary>The set of Summary objects.
To add Summary objects one at a time instead of replacing the collection, use addToSummaries.

setDeepPaging

SearchParams setDeepPaging(DeepPaging deepPaging)

Sets a DeepPaging object as a query parameter.

ParameterTypeDescription
deepPagingDeepPagingThe DeepPaging object.

Adders

addToQueryProcessorNames

void addToQueryProcessorNames(String qpName)

Adds a single query analyzer.

ParameterTypeDescription
qpNameStringThe query analyzer to add.

addToAggregates

void addToAggregates(Aggregate aggregate)

Adds a single Aggregate object to the existing collection.

ParameterTypeDescription
aggregateAggregateThe Aggregate object to add.

addToDistincts

void addToDistincts(Distinct distinct)

Adds a single Distinct object to the existing collection.

ParameterTypeDescription
distinctDistinctThe Distinct object to add.

addToSummaries

void addToSummaries(Summary summary)

Adds a single Summary object to the existing collection.

ParameterTypeDescription
summarySummaryThe Summary object to add.

Getters

getQuery

String getQuery()

Returns the query keyword.

getSuggest

Suggest getSuggest()

Returns the Suggest object set as a query parameter.

getConfig

Config getConfig()

Returns the Config object set as a query parameter.

getQueryProcessorNames

List<String> getQueryProcessorNames()

Returns the list of query analyzers.

getAggregates

Set<Aggregate> getAggregates()

Returns the set of Aggregate objects.

getDistincts

Set<Distinct> getDistincts()

Returns the set of Distinct objects.

getRank

Rank getRank()

Returns the Rank object set as a query parameter.

getSort

Sort getSort()

Returns the Sort object set as a query parameter.

getSummaries

Set<Summary> getSummaries()

Returns the set of Summary objects.

getDeepPaging

DeepPaging getDeepPaging()

Returns the DeepPaging object set as a query parameter.