Package com.loop54.model.request
Class SuggestRequest
java.lang.Object
com.loop54.model.request.Request
com.loop54.model.request.ContentRequest
com.loop54.model.request.SuggestRequest
This class is used for performing suggest requests to the Loop54 e-commerce search engine.
-
Field Summary
FieldsModifier and TypeFieldDescriptionParameters for specifying how the suggest results should be retrieved.final StringThe partial query that the user has entered.Parameters for specifying which direct results to retrieve.final booleanWhen 'true', the search may run against the top suggested autocompletion for the input query.Fields inherited from class com.loop54.model.request.ContentRequest
contentResultsOptionsFields inherited from class com.loop54.model.request.Request
customData -
Constructor Summary
ConstructorsConstructorDescriptionSuggestRequest(String query) The partial query that the user has entered.SuggestRequest(String query, boolean useTopSuggestionForSearch) The partial query that the user has entered. -
Method Summary
Modifier and TypeMethodDescriptionwithCustomData(String key, Object value) Chainable variant ofRequest.addCustomData(String, Object).withQueries(Consumer<QueryCollectionParameters> configurator) ConfiguresqueriesOptions, e.g.withResults(Consumer<EntityCollectionParameters> configurator) ConfiguresresultsOptions, e.g.Methods inherited from class com.loop54.model.request.ContentRequest
addContentResultsOptions, withContentResultsMethods inherited from class com.loop54.model.request.Request
addCustomData
-
Field Details
-
query
The partial query that the user has entered. -
useTopSuggestionForSearch
public final boolean useTopSuggestionForSearchWhen 'true', the search may run against the top suggested autocompletion for the input query. -
queriesOptions
Parameters for specifying how the suggest results should be retrieved. Contains paging and sorting options. -
resultsOptions
Parameters for specifying which direct results to retrieve. Such as filtering, faceting, sorting and paging.
-
-
Constructor Details
-
SuggestRequest
The partial query that the user has entered.- Parameters:
query- the query to get auto complete suggestions for.
-
SuggestRequest
The partial query that the user has entered.- Parameters:
query- the query to get auto complete suggestions for.useTopSuggestionForSearch- When 'true', the search may run against the top suggested autocompletion for the input query.
-
-
Method Details
-
withQueries
ConfiguresqueriesOptions, e.g.request.withQueries(q -> q.page(0, 10)).- Parameters:
configurator- Applied toqueriesOptions.- Returns:
- This request, for chaining.
-
withResults
ConfiguresresultsOptions, e.g.request.withResults(r -> r.page(0, 20).distinctFacet("Category")).- Parameters:
configurator- Applied toresultsOptions.- Returns:
- This request, for chaining.
-
withCustomData
Description copied from class:RequestChainable variant ofRequest.addCustomData(String, Object). Subclasses override this to return their own type.- Overrides:
withCustomDatain classRequest- Parameters:
key- Key to set the data on. The keys will be treated as case-sensitive.value- Value to add to the custom data.- Returns:
- This request, for chaining.
-