Class QuerySuggestManager

  • All Implemented Interfaces:
    AutoCloseable

    public class QuerySuggestManager
    extends Object
    implements 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.

    • Method Detail

      • setUpdateRate

        @Deprecated
        public void setUpdateRate​(int seconds)
        Deprecated.
        use builder instead!
        Set the rate (in seconds) at which the update should run. The value must be 5 <= x <= 3600. That rate is only applied to QuerySuggesters that will be fetched from the time after this value is set.
        Parameters:
        seconds -
      • getQuerySuggester

        public QuerySuggester getQuerySuggester​(@NonNull
                                                @NonNull String indexName)
        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

        public QuerySuggester getQuerySuggester​(@NonNull
                                                @NonNull String indexName,
                                                boolean synchronous)
      • destroyQuerySuggester

        public void destroyQuerySuggester​(String indexName)