Package com.day.cq.search.suggest
Interface SuggestionIndexManager
-
public interface SuggestionIndexManager
Service interface for managingSuggestionIndex
es, e.g. reading, creating and deleting them.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
delete(java.lang.String name)
Deprecated.useget(session, name).delete()
SuggestionIndex
get(java.lang.String name)
Deprecated.use the variant with a session:get(Session, String)
SuggestionIndex
get(Session session, java.lang.String name)
Gets or creates a suggestion index.java.lang.Iterable<java.lang.String>
list()
Deprecated.use the variant with a session:list(Session)
java.lang.Iterable<java.lang.String>
list(Session session)
Lists the available suggestions indexes.
-
-
-
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 indexname
- 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 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(java.lang.String name) throws RepositoryException
Deprecated.use the variant with a session:get(Session, String)
- Throws:
RepositoryException
-
delete
@Deprecated void delete(java.lang.String name) throws RepositoryException
Deprecated.useget(session, name).delete()
- Throws:
RepositoryException
-
list
@Deprecated java.lang.Iterable<java.lang.String> list() throws RepositoryException
Deprecated.use the variant with a session:list(Session)
- Throws:
RepositoryException
-
-