Interface SearchRequestBuilder
@ProviderType
public interface SearchRequestBuilder
Builds a search request that can be used for executing a search.
-
Method Summary
Modifier and TypeMethodDescriptionaddAggregation
(Aggregation aggregation) addComplexQueryPart
(ComplexQueryPart complexQueryPart) addFederatedSearchRequest
(SearchRequest searchRequest) addPipelineAggregation
(PipelineAggregation pipelineAggregation) addPostFilterQueryPart
(ComplexQueryPart complexQueryPart) addRescore
(Rescore rescore) addSelectedFieldNames
(String... selectedFieldNames) Adds fields to include in the search results as a map of keys and values.basicFacetSelection
(boolean basicFacetSelection) build()
Builds the search request.connectionId
(String connectionId) emptySearchEnabled
(boolean emptySearchEnabled) entryClassNames
(String... entryClassNames) excludeContributors
(String... ids) explain
(boolean explain) Enables explanation of how each hit's score was computed.federatedSearchKey
(String federatedSearchKey) fetchSource
(boolean fetchSource) fetchSourceExcludes
(String[] fetchSourceExcludes) fetchSourceIncludes
(String[] fetchSourceIncludes) getFederatedSearchRequestBuilder
(String federatedSearchKey) groupByRequests
(GroupByRequest... groupByRequests) Provides a top hits aggregations for each of the specified fields.groupIds
(long... groupIds) highlightEnabled
(boolean highlightEnabled) highlightFields
(String... highlightFields) includeContributors
(String... ids) includeResponseString
(boolean includeResponseString) Enables inclusion of the search engine's response string with the returned results.modelIndexerClasses
(Class<?>... classes) modelIndexerClassNames
(String... classNames) ownerUserId
(Long userId) void
paginationStartParameterName
(String paginationStartParameterName) postFilterQuery
(Query query) queryString
(String queryString) rescoreQuery
(Query rescoreQuery) Deprecated.Provides secondary queries to reorder the top documents returned.retainFacetSelections
(boolean retainFacetSelections) statsRequests
(StatsRequest... statsRequests) Provides the metric aggregations to be computed for each field.storedFields
(String... storedFields) withFacetContext
(Consumer<FacetContext> facetContextConsumer) <T> T
withFacetContextGet
(Function<FacetContext, T> facetContextFunction) withSearchContext
(Consumer<com.liferay.portal.kernel.search.SearchContext> searchContextConsumer) <T> T
withSearchContextGet
(Function<com.liferay.portal.kernel.search.SearchContext, T> searchContextFunction) withSearchRequestBuilder
(Consumer<SearchRequestBuilder>... searchRequestBuilderConsumers)
-
Method Details
-
addAggregation
-
addComplexQueryPart
-
addFederatedSearchRequest
-
addIndex
-
addPipelineAggregation
-
addPostFilterQueryPart
-
addRescore
-
addSelectedFieldNames
Adds fields to include in the search results as a map of keys and values.- Parameters:
selectedFieldNames
- the names of the fields to return- Returns:
- the search request builder
-
addSort
-
basicFacetSelection
-
build
SearchRequest build()Builds the search request.- Returns:
- the search request
-
collapse
-
companyId
-
connectionId
-
emptySearchEnabled
-
entryClassNames
-
excludeContributors
-
explain
Enables explanation of how each hit's score was computed.- Parameters:
explain
- whether to explain scores- Returns:
- the search request builder
-
federatedSearchKey
-
fetchSource
-
fetchSourceExcludes
-
fetchSourceIncludes
-
fields
-
from
-
getFederatedSearchRequestBuilder
-
groupByRequests
Provides a top hits aggregations for each of the specified fields.- Parameters:
groupByRequests
- the grouping that is enabled for each field- Returns:
- the search request builder
-
groupIds
-
highlight
-
highlightEnabled
-
highlightFields
-
includeContributors
-
includeResponseString
Enables inclusion of the search engine's response string with the returned results.- Parameters:
includeResponseString
- whether to include the response string- Returns:
- the search request builder
-
indexes
-
locale
-
modelIndexerClasses
-
modelIndexerClassNames
-
ownerUserId
-
paginationStartParameterName
-
postFilterQuery
-
query
-
queryString
-
rescoreQuery
Deprecated.As of Athanasius (7.3.x), replaced byrescores(List)
-
rescores
Provides secondary queries to reorder the top documents returned.- Parameters:
rescores
- the rescore queries- Returns:
- the search request builder
-
retainFacetSelections
-
size
-
sorts
-
statsRequests
Provides the metric aggregations to be computed for each field.- Parameters:
statsRequests
- the stats that are enabled for each field- Returns:
- the search request builder
-
storedFields
-
withFacetContext
-
withFacetContextGet
-
withSearchContext
SearchRequestBuilder withSearchContext(Consumer<com.liferay.portal.kernel.search.SearchContext> searchContextConsumer) -
withSearchContextGet
<T> T withSearchContextGet(Function<com.liferay.portal.kernel.search.SearchContext, T> searchContextFunction) -
withSearchRequestBuilder
SearchRequestBuilder withSearchRequestBuilder(Consumer<SearchRequestBuilder>... searchRequestBuilderConsumers)
-
rescores(List)