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
| Signature | Description |
|---|---|
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.
| Parameter | Type | Description |
|---|---|---|
query | String | The query keyword. |
setFilter
SearchParams setFilter(String filter)Sets the filter condition to narrow search results.
| Parameter | Type | Description |
|---|---|---|
filter | String | The filter condition. |
setSuggest
SearchParams setSuggest(Suggest suggest)Sets a Suggest object as a query parameter.
| Parameter | Type | Description |
|---|---|---|
suggest | Suggest | The Suggest object. |
setConfig
SearchParams setConfig(Config config)Sets a Config object as a query parameter.
| Parameter | Type | Description |
|---|---|---|
config | Config | The Config object. |
setQueryProcessorNames
SearchParams setQueryProcessorNames(List<String> queryProcessorNames)Sets the full list of query analyzers.
| Parameter | Type | Description |
|---|---|---|
queryProcessorNames | List<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.
| Parameter | Type | Description |
|---|---|---|
aggreates | Set<Aggregate> | The set of Aggregate objects. |
To addAggregateobjects one at a time instead of replacing the collection, useaddToAggregates.
setDistincts
SearchParams setDistincts(Set<Distinct> distincts)Sets the full collection of Distinct objects.
| Parameter | Type | Description |
|---|---|---|
distincts | Set<Distinct> | The set of Distinct objects. |
To addDistinctobjects one at a time instead of replacing the collection, useaddToDistincts.
setRank
SearchParams setRank(Rank rank)Sets a Rank object as a query parameter.
| Parameter | Type | Description |
|---|---|---|
rank | Rank | The Rank object. |
setSort
SearchParams setSort(Sort sort)Sets a Sort object as a query parameter.
| Parameter | Type | Description |
|---|---|---|
sort | Sort | The Sort object. |
setSummaries
SearchParams setSummaries(Set<Summary> summaries)Sets the full collection of Summary objects.
| Parameter | Type | Description |
|---|---|---|
summaries | Set<Summary> | The set of Summary objects. |
To addSummaryobjects one at a time instead of replacing the collection, useaddToSummaries.
setDeepPaging
SearchParams setDeepPaging(DeepPaging deepPaging)Sets a DeepPaging object as a query parameter.
| Parameter | Type | Description |
|---|---|---|
deepPaging | DeepPaging | The DeepPaging object. |
Adders
addToQueryProcessorNames
void addToQueryProcessorNames(String qpName)Adds a single query analyzer.
| Parameter | Type | Description |
|---|---|---|
qpName | String | The query analyzer to add. |
addToAggregates
void addToAggregates(Aggregate aggregate)Adds a single Aggregate object to the existing collection.
| Parameter | Type | Description |
|---|---|---|
aggregate | Aggregate | The Aggregate object to add. |
addToDistincts
void addToDistincts(Distinct distinct)Adds a single Distinct object to the existing collection.
| Parameter | Type | Description |
|---|---|---|
distinct | Distinct | The Distinct object to add. |
addToSummaries
void addToSummaries(Summary summary)Adds a single Summary object to the existing collection.
| Parameter | Type | Description |
|---|---|---|
summary | Summary | The 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.