Package com.day.cq.search.suggest
Interface SuggestionIndexManager
-
public interface SuggestionIndexManagerService interface for managingSuggestionIndexes, e.g. reading, creating and deleting them.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voiddelete(String name)Deprecated.useget(session, name).delete()SuggestionIndexget(String name)Deprecated.use the variant with a session:get(Session, String)SuggestionIndexget(Session session, String name)Gets or creates a suggestion index.Iterable<String>list()Deprecated.use the variant with a session:list(Session)Iterable<String>list(Session session)Lists the available suggestions indexes.
-
-
-
Method Detail
-
get
SuggestionIndex get(Session session, 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
closethe 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 indexname- name or path of the index- Returns:
- a suggestion index
- Throws:
RepositoryException- if an unexpected repository problem occurred
-
list
Iterable<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 withget(String)anddelete(String).- Parameters:
session- session for listing the indexes- Returns:
- a list of index names (relative paths)
- Throws:
RepositoryException- if an unexpected repository problem occurred
-
get
@Deprecated SuggestionIndex get(String name) throws RepositoryException
Deprecated.use the variant with a session:get(Session, String)- Throws:
RepositoryException
-
delete
@Deprecated void delete(String name) throws RepositoryException
Deprecated.useget(session, name).delete()- Throws:
RepositoryException
-
list
@Deprecated Iterable<String> list() throws RepositoryException
Deprecated.use the variant with a session:list(Session)- Throws:
RepositoryException
-
-