Interface SuggestionIndexManager


  • public interface SuggestionIndexManager
    Service interface for managing SuggestionIndexes, e.g. reading, creating and deleting them.
    • Method Detail

      • get

        SuggestionIndex get​(Session session,
                            java.lang.String name)
                     throws RepositoryException
        Gets or creates a suggestion index. The index will be created on demand when the first term is added.

        Note: make sure to close the index after usage to properly release affected resources, e.g. the underlying JCR session. This should be done in a try/finally block.

        The returned index is not thread-safe.

        Parameters:
        session - session for reading (or writing) the index
        name - name or path of the index
        Returns:
        a suggestion index
        Throws:
        RepositoryException - if an unexpected repository problem occurred
      • list

        java.lang.Iterable<java.lang.String> list​(Session session)
                                           throws RepositoryException
        Lists the available suggestions indexes.

        If the indexes were created with path names in get(String), these will always be returned as relative paths, ie. without a leading slash. Both variants, "/index" and "index" will work with get(String) and delete(String).

        Parameters:
        session - session for listing the indexes
        Returns:
        a list of index names (relative paths)
        Throws:
        RepositoryException - if an unexpected repository problem occurred