Interface SuggestionIndexManager


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

      • get

        SuggestionIndex get​(javax.jcr.Session session,
                            java.lang.String name)
                     throws javax.jcr.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:
        javax.jcr.RepositoryException - if an unexpected repository problem occurred
      • list

        java.lang.Iterable<java.lang.String> list​(javax.jcr.Session session)
                                           throws javax.jcr.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:
        javax.jcr.RepositoryException - if an unexpected repository problem occurred
      • get

        @Deprecated
        SuggestionIndex get​(java.lang.String name)
                     throws javax.jcr.RepositoryException
        Deprecated.
        use the variant with a session: get(Session, String)
        Throws:
        javax.jcr.RepositoryException
      • delete

        @Deprecated
        void delete​(java.lang.String name)
             throws javax.jcr.RepositoryException
        Deprecated.
        use get(session, name).delete()
        Throws:
        javax.jcr.RepositoryException
      • list

        @Deprecated
        java.lang.Iterable<java.lang.String> list()
                                           throws javax.jcr.RepositoryException
        Deprecated.
        use the variant with a session: list(Session)
        Throws:
        javax.jcr.RepositoryException