Package de.cxp.ocs.smartsuggest
Class QuerySuggestManager
java.lang.Object
de.cxp.ocs.smartsuggest.QuerySuggestManager
- All Implemented Interfaces:
AutoCloseable
The QuerySuggestManager
cares about the creation of
QuerySuggester
objects and
also makes sure they are coupled to an internal asynchronous update process
which is scheduled according a configurable update rate.
Since the QuerySuggestManager
internally holds an executor service,
it must be
closed when it and the created QuerySuggester instances are no longer in use.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
This builder should be used to set up the QuerySuggestManager -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
void
close()
void
destroyQuerySuggester
(String indexName) getQuerySuggester
(@NonNull String indexName) Retrieves the query suggester for the given indexName.getQuerySuggester
(@NonNull String indexName, boolean synchronous)
-
Field Details
-
DEBUG_PROPERTY
- See Also:
-
defaultLimiter
-
-
Method Details
-
builder
-
getQuerySuggester
Retrieves the query suggester for the given indexName. Initializes a new query suggester if non exists yet, for that client. A background job ensures the data of that query suggester get's updated regularly.- Parameters:
indexName
- index name of the wanted suggester- Returns:
- initialized query suggester
-
getQuerySuggester
-
destroyQuerySuggester
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-