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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
SearchIndexSuggestionExtractor.Options
Data object for holding all configuration options forbuildIndex(Session, String, Options)
.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
buildIndex(Session session, java.lang.String indexName, SearchIndexSuggestionExtractor.Options options)
Creates or updates theindex
at the given path based on terms extracted from the Lucene search index of the underlying CRX/Jackrabbit repository.
-
-
-
Method Detail
-
buildIndex
int buildIndex(Session session, java.lang.String indexName, SearchIndexSuggestionExtractor.Options options)
Creates or updates theindex
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 givenSession
. Various configuration parameters, for example which fields from the index to use and what stop words list to use, can be passed via theSearchIndexSuggestionExtractor.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
SearchIndexSuggestionExtractor.Options.properties
.- Parameters:
session
- used to access the Lucene index for the workspaceindexName
- name or path for theSuggestionIndex
to create or updateoptions
- configuration parameters- Returns:
- the number of extracted terms
-
-