public interface QueryHandler
Modifier and Type | Method and Description |
---|---|
void |
addNode(org.exoplatform.services.jcr.datamodel.NodeData node)
Adds a
Node to the search index. |
void |
apply(org.exoplatform.services.jcr.impl.core.query.lucene.ChangesHolder changes)
Applies the given changes to the indes in an atomic operation
|
void |
checkIndex(org.exoplatform.services.jcr.dataflow.ItemDataConsumer itemStateManager,
boolean isSystem,
org.exoplatform.services.jcr.impl.checker.InspectionReport report)
Check index consistency.
|
void |
close()
Closes this
QueryHandler and frees resources attached
to this handler. |
org.exoplatform.services.jcr.impl.core.query.ExecutableQuery |
createExecutableQuery(org.exoplatform.services.jcr.impl.core.SessionImpl session,
org.exoplatform.services.jcr.impl.core.SessionDataManager itemMgr,
String statement,
String language)
Creates a new query by specifying the query statement itself and the
language in which the query is stated.
|
void |
deleteNode(String id)
Deletes the Node with
id from the search index. |
org.exoplatform.services.jcr.impl.core.query.lucene.QueryHits |
executeQuery(org.apache.lucene.search.Query query)
Executes the query on the search index.
|
org.exoplatform.services.jcr.impl.core.query.lucene.ChangesHolder |
getChanges(Iterator<String> remove,
Iterator<org.exoplatform.services.jcr.datamodel.NodeData> add)
Extracts all the changes and returns them as a
ChangesHolder instance |
org.exoplatform.services.jcr.impl.core.query.QueryHandlerContext |
getContext()
Returns the query handler context that passed in
setContext(QueryHandlerContext) . |
org.exoplatform.services.jcr.impl.core.query.IndexerIoModeHandler |
getIndexerIoModeHandler() |
org.exoplatform.services.jcr.impl.core.query.lucene.IndexInfos |
getIndexInfos()
Returns
IndexInfos instance that was set into QueryHandler. |
org.exoplatform.services.jcr.impl.core.query.lucene.IndexUpdateMonitor |
getIndexUpdateMonitor() |
String |
getQueryClass() |
void |
init()
initializes QueryHandler
|
boolean |
isInitialized()
Checks whether QueryHandler is initialized or not
|
boolean |
isOnline()
Offline mode means that new indexing data is collected but index is guaranteed to be unmodified during
offline state.
|
void |
logErrorChanges(Set<String> removed,
Set<String> added)
Log unindexed changes into error.log
|
void |
setContext(org.exoplatform.services.jcr.impl.core.query.QueryHandlerContext context)
Sets QueryHandlerContext
|
void |
setIndexerIoModeHandler(org.exoplatform.services.jcr.impl.core.query.IndexerIoModeHandler handler) |
void |
setIndexInfos(org.exoplatform.services.jcr.impl.core.query.lucene.IndexInfos indexInfos)
Sets
IndexInfos instance into QueryHandler, which is later passed to MultiIndex . |
void |
setIndexUpdateMonitor(org.exoplatform.services.jcr.impl.core.query.lucene.IndexUpdateMonitor indexUpdateMonitor) |
void |
setOnline(boolean isOnline,
boolean allowQuery,
boolean dropStaleIndexes)
Switches index into corresponding ONLINE or OFFLINE mode.
|
void |
updateNodes(Iterator<String> remove,
Iterator<org.exoplatform.services.jcr.datamodel.NodeData> add)
Updates the index in an atomic operation.
|
org.exoplatform.services.jcr.impl.core.query.QueryHandlerContext getContext()
setContext(QueryHandlerContext)
.void addNode(org.exoplatform.services.jcr.datamodel.NodeData node) throws javax.jcr.RepositoryException, IOException
Node
to the search index.node
- the NodeState to add.javax.jcr.RepositoryException
- if an error occurs while indexing the node.IOException
- if an error occurs while adding the node to the index.void deleteNode(String id) throws IOException
id
from the search index.id
- the id
of the node to delete.IOException
- if an error occurs while deleting the node.void updateNodes(Iterator<String> remove, Iterator<org.exoplatform.services.jcr.datamodel.NodeData> add) throws javax.jcr.RepositoryException, IOException
remove
- Iterator of NodeIds
of nodes to deleteadd
- Iterator of NodeState
instance to add to the
index.javax.jcr.RepositoryException
- if an error occurs while indexing a node.IOException
- if an error occurs while updating the index.org.exoplatform.services.jcr.impl.core.query.lucene.ChangesHolder getChanges(Iterator<String> remove, Iterator<org.exoplatform.services.jcr.datamodel.NodeData> add)
ChangesHolder
instanceremove
- Iterator of NodeIds
of nodes to deleteadd
- Iterator of NodeState
instance to add to the
index.ChangesHolder
instance that contains all the changesvoid apply(org.exoplatform.services.jcr.impl.core.query.lucene.ChangesHolder changes) throws javax.jcr.RepositoryException, IOException
changes
- the changes to applyjavax.jcr.RepositoryException
- if an error occurs while indexing a node.IOException
- if an error occurs while updating the index.void close()
QueryHandler
and frees resources attached
to this handler.void setContext(org.exoplatform.services.jcr.impl.core.query.QueryHandlerContext context)
context
- void init() throws IOException, javax.jcr.RepositoryException, org.exoplatform.services.jcr.config.RepositoryConfigurationException
IOException
javax.jcr.RepositoryException
org.exoplatform.services.jcr.config.RepositoryConfigurationException
boolean isInitialized()
org.exoplatform.services.jcr.impl.core.query.ExecutableQuery createExecutableQuery(org.exoplatform.services.jcr.impl.core.SessionImpl session, org.exoplatform.services.jcr.impl.core.SessionDataManager itemMgr, String statement, String language) throws javax.jcr.query.InvalidQueryException
language
must specify a query language
string from among those returned by QueryManager.getSupportedQueryLanguages(); if it is not
then an InvalidQueryException
is thrown.session
- the session of the current user creating the query object.itemMgr
- the item manager of the current user.statement
- the query statement.language
- the syntax of the query statement.Query
object.javax.jcr.query.InvalidQueryException
- if statement is invalid or language is unsupported.void logErrorChanges(Set<String> removed, Set<String> added) throws IOException
removed
- set of removed node uuidsadded
- map of added node states and uuidsIOException
void setIndexerIoModeHandler(org.exoplatform.services.jcr.impl.core.query.IndexerIoModeHandler handler) throws IOException
IOException
org.exoplatform.services.jcr.impl.core.query.IndexerIoModeHandler getIndexerIoModeHandler()
String getQueryClass()
org.exoplatform.services.jcr.impl.core.query.lucene.QueryHits executeQuery(org.apache.lucene.search.Query query) throws IOException
query
- the lucene query.IOException
- if an error occurs while searching the index.void setIndexInfos(org.exoplatform.services.jcr.impl.core.query.lucene.IndexInfos indexInfos)
IndexInfos
instance into QueryHandler, which is later passed to MultiIndex
.indexInfos
- org.exoplatform.services.jcr.impl.core.query.lucene.IndexInfos getIndexInfos()
IndexInfos
instance that was set into QueryHandler.org.exoplatform.services.jcr.impl.core.query.lucene.IndexUpdateMonitor getIndexUpdateMonitor()
void setIndexUpdateMonitor(org.exoplatform.services.jcr.impl.core.query.lucene.IndexUpdateMonitor indexUpdateMonitor)
indexUpdateMonitor
- the indexUpdateMonitor to setvoid setOnline(boolean isOnline, boolean allowQuery, boolean dropStaleIndexes) throws IOException
isOnline
- allowQuery
- doesn't matter, when switching index to onlinedropStaleIndexes
- doesn't matter, when switching index to onlineIOException
boolean isOnline()
void checkIndex(org.exoplatform.services.jcr.dataflow.ItemDataConsumer itemStateManager, boolean isSystem, org.exoplatform.services.jcr.impl.checker.InspectionReport report) throws javax.jcr.RepositoryException, IOException
itemStateManager
- isSystem
- report
- javax.jcr.RepositoryException
IOException
Copyright © 2003–2019 eXo Platform SAS. All rights reserved.