Interface SearchIndexSuggestionExtractor

  • public interface SearchIndexSuggestionExtractor
    A service interface for creating or updating a suggestion index based on repository content using the information from the Lucene search index. Will extract the most frequent terms and build suggestions based on them.

    Note: This only works with CRX / Jackrabbit as the underlying JCR repository, as this has to access the Lucene index directly to extract the terms; the search part of the JCR API does not cover this special case.

    • Method Detail

      • buildIndex

        int buildIndex​(Session session,
                       java.lang.String indexName,
                       SearchIndexSuggestionExtractor.Options options)
        Creates or updates the index at the given path based on terms extracted from the Lucene search index of the underlying CRX/Jackrabbit repository. Uses the index of the workspace behind the given Session. Various configuration parameters, for example which fields from the index to use and what stop words list to use, can be passed via the SearchIndexSuggestionExtractor.Options.

        Note that this will take terms from the entire repository. Restricting it to content in a JCR subtree is not possible as this information is not stored in the Lucene index. A trick is to store the text to be indexed in a unique property (and maybe in a separate workspace or repository), which is not used by other content. This property would then be specified in

        session - used to access the Lucene index for the workspace
        indexName - name or path for the SuggestionIndex to create or update
        options - configuration parameters
        the number of extracted terms