The hostname including protocol (eg.: https://my.smartsearch.backend).
The name of the prepared search to address.
The additional options to override the default parameters of the API endpoint, the render function and autocomplete function.
The API endpoint to which auto-complete and search queries are sent. As default the API_ENDPOINT is used.
The hostname including protocol (eg.: https://my.smartsearch.backend).
The additional options to override the default parameters of the API endpoint, the render function and autocomplete function.
The name of the prepared search to address.
This function attaches an autocomplete widget to the given input element. The css styling classes are:
.smart-search-autocomplete-widget
will be attached to the div-container displaying the list of autocomplete
suggestions.
.smart-search-autocomplete-active
will be attached to the cursor for the actively selected autocomplete widget
.
.smart-search-autocomplete-item
will be attached to a single autocomplete suggestion.
#inputElement.id autocomplete-widget
will be attached to the autocomplete-list.
The input element to attach this widget to
Optional. A div to attach the autocomplete widget to. If this parameter is left empty, the widget will be attached to the parent of the input element.
Deletes all parameters with keys matching the list of keys passed in
one or more keys to be deleted
Fetches the autocomplete suggestions matching the given prefix from the backend. The resulting array always has the length 5 and is sorted by relevance.
What the user typed so far.
Returns a page renderer object that provides functions to render pagination and search results
the page to berendered
Sends a search request with the query term and the grouping options. For the method to work, the following groovy script must be added to the prepared search.
def grouping = "off"
grouping = parameter.get("grouping")?.get(0)
def groupField = parameter.get("groupField")?.get(0)
def groupLimit = parameter.get("groupLimit")?.get(0)
if (grouping?.equals("on")) {
solrQuery.set("group", true)
solrQuery.set("group.field", groupField)
solrQuery.set("group.limit", groupLimit)
}
The search term to use in the api request.
The name of the field by which to group results.
The number of results to return for each group. 1 is default, -1 returns all results for each group.
A map consisting of the group value and the corresponding Page that contains the search results.
Sets custom parameters to be used in all requests to the SmartSearch backend. The same key may occur multiple times. If you call this function a second time you will overwrite all previously set parameters regardless of whether the keys are the same or not.
one or multiple objects of type URLParam
Generated using TypeDoc
Wrapper for the SmartSearch prepared search API. Main class and entrypoint for this library.