public class JahiaSearchIndex
extends org.apache.jackrabbit.core.query.lucene.SearchIndex
QueryHandler using Lucene and handling Jahia specific definitions.| Modifier and Type | Class and Description |
|---|---|
static class |
JahiaSearchIndex.ReindexJob
Background job that performs re-indexing of the repository content for the specified workspaces.
|
| Modifier and Type | Field and Description |
|---|---|
static boolean |
SKIP_VERSION_INDEX |
static String |
SKIP_VERSION_INDEX_SYSTEM_PROPERTY |
DEFAULT_EXTRACTOR_BACK_LOG, DEFAULT_EXTRACTOR_POOL_SIZE, DEFAULT_EXTRACTOR_TIMEOUT, DEFAULT_MAX_FIELD_LENGTH, DEFAULT_MAX_MERGE_DOCS, DEFAULT_MERGE_FACTOR, DEFAULT_MIN_MERGE_DOCS, DEFAULT_TERM_INFOS_INDEX_DIVISOR, index, JCR_SYSTEM_PATH, PATH_FACTORY, ROOT_PATH, VALID_SYSTEM_INDEX_NODE_TYPE_NAMES| Constructor and Description |
|---|
JahiaSearchIndex() |
| Modifier and Type | Method and Description |
|---|---|
protected org.apache.lucene.document.Document |
createDocument(org.apache.jackrabbit.core.state.NodeState node,
org.apache.jackrabbit.core.query.lucene.NamespaceMappings nsMappings,
org.apache.jackrabbit.core.query.lucene.IndexFormatVersion indexFormatVersion) |
org.apache.jackrabbit.core.query.ExecutableQuery |
createExecutableQuery(org.apache.jackrabbit.core.session.SessionContext sessionContext,
String statement,
String language) |
protected org.apache.jackrabbit.core.query.lucene.IndexingConfiguration |
createIndexingConfiguration(org.apache.jackrabbit.core.query.lucene.NamespaceMappings namespaceMappings) |
protected org.apache.tika.parser.Parser |
createParser() |
javax.jcr.query.qom.QueryObjectModel |
createQueryObjectModel(org.apache.jackrabbit.core.session.SessionContext sessionContext,
org.apache.jackrabbit.spi.commons.query.qom.QueryObjectModelTree qomTree,
String language,
javax.jcr.Node node) |
protected void |
doInit() |
org.apache.jackrabbit.core.query.lucene.MultiColumnQueryHits |
executeQuery(org.apache.jackrabbit.core.SessionImpl session,
org.apache.jackrabbit.core.query.lucene.AbstractQueryImpl queryImpl,
org.apache.lucene.search.Query query,
org.apache.jackrabbit.spi.Path[] orderProps,
boolean[] orderSpecs,
String[] orderFuncs,
long resultFetchHint)
Executes the query on the search index.
|
org.apache.jackrabbit.core.query.lucene.MultiColumnQueryHits |
executeQuery(org.apache.jackrabbit.core.SessionImpl session,
org.apache.jackrabbit.core.query.lucene.MultiColumnQuery query,
org.apache.jackrabbit.core.query.lucene.Ordering[] orderings,
long resultFetchHint)
Executes the query on the search index.
|
protected org.apache.jackrabbit.core.query.lucene.AnalyzerRegistry |
getAnalyzerRegistry() |
int |
getBatchSize() |
int |
getDefaultWaitTime() |
protected org.apache.lucene.index.IndexReader |
getIndexReader(boolean includeSystemIndex) |
int |
getMaxClauseCount() |
Set<String> |
getTypesUsingOptimizedACEIndexation()
Return the list of types which can benefit of the optimized ACE indexation.
|
Iterable<org.apache.jackrabbit.core.id.NodeId> |
getWeaklyReferringNodes(org.apache.jackrabbit.core.id.NodeId id) |
static boolean |
isAclUuidInIndex(org.apache.jackrabbit.core.query.lucene.SearchIndex index)
Returns
true if the supplied SearchIndex implementation has ACL-UUID stored in index. |
boolean |
isAddAclUuidInIndex()
Returns
true if ACL-UUID should be resolved and stored in index. |
protected boolean |
isNodeExcluded(org.apache.jackrabbit.core.state.NodeState node) |
boolean |
prepareReindexing()
Prepares for a re-indexing of the repository content, creating a secondary index instance.
|
void |
reindexTree(String startNodeId)
Re-indexes the full JCR sub-tree, starting from the specified node.
|
void |
scheduleReindexing()
Schedules the re-indexing of the repository content in a background job.
|
void |
setAddAclUuidInIndex(boolean addAclUuidInIndex) |
void |
setBatchSize(int batchSize)
Set the maximum number of documents that will be sent in one batch to the index for certain
mass indexing requests, like after ACL change
|
void |
setDefaultWaitTime(int defaultWaitTime) |
void |
setIgnoredTypes(String ignoredTypes) |
void |
setMaxClauseCount(int maxClauseCount) |
void |
setTypesUsingOptimizedACEIndexation(String typesUsingOptimizedACEIndexation) |
void |
switchReadOnlyMode(boolean enable) |
void |
updateNodes(Iterator<org.apache.jackrabbit.core.id.NodeId> remove,
Iterator<org.apache.jackrabbit.core.state.NodeState> add)
We override this method in order to trigger re-indexing on translation nodes, when their
parent node is getting re-indexed.
|
addNode, checkOpen, close, createDirectoryManager, createExcerptProvider, createOrderings, createRedoLogFactory, createSortFields, createSpellChecker, createSynonymProvider, createSynonymProviderConfigResource, deleteNode, flush, getAnalyzer, getAutoRepair, getBufferSize, getCacheSize, getDirectoryManager, getDirectoryManagerClass, getEnableConsistencyCheck, getExcerptProviderClass, getExtractorBackLogSize, getExtractorPoolSize, getExtractorTimeout, getForceConsistencyCheck, getForkJavaCommand, getIndex, getIndexFormatVersion, getIndexingConfig, getIndexingConfiguration, getIndexingConfigurationClass, getIndexingConfigurationDOM, getIndexReader, getMaxExtractLength, getMaxFieldLength, getMaxHistoryAge, getMaxMergeDocs, getMaxVolatileIndexSize, getMergeFactor, getMinMergeDocs, getNamespaceMappings, getParser, getPath, getQueryNodeFactory, getRedoLogFactory, getRedoLogFactoryClass, getRelativePath, getRespectDocumentOrder, getResultFetchSize, getSimilarity, getSimilarityClass, getSizeEstimate, getSortComparatorSource, getSpellChecker, getSpellCheckerClass, getSupportHighlighting, getSynonymProvider, getSynonymProviderClass, getSynonymProviderConfigPath, getTermInfosIndexDivisor, getTextAnalyzer, getTextFilterClasses, getTikaConfigPath, getUseCompoundFile, getVolatileIdleTime, isInitializeHierarchyCache, isUseSimpleFSDirectory, mergeAggregatedNodeIndexes, retrieveAggregateRoot, retrieveAggregateRoot, runConsistencyCheck, setAnalyzer, setAutoRepair, setBufferSize, setCacheSize, setDirectoryManagerClass, setEnableConsistencyCheck, setExcerptProviderClass, setExtractorBackLogSize, setExtractorPoolSize, setExtractorTimeout, setForceConsistencyCheck, setForkJavaCommand, setIndexingConfiguration, setIndexingConfigurationClass, setInitializeHierarchyCache, setMaxExtractLength, setMaxFieldLength, setMaxHistoryAge, setMaxMergeDocs, setMaxVolatileIndexSize, setMergeFactor, setMinMergeDocs, setPath, setRedoLogFactoryClass, setRespectDocumentOrder, setResultFetchSize, setSimilarityClass, setSizeEstimate, setSpellCheckerClass, setSupportHighlighting, setSynonymProviderClass, setSynonymProviderConfigPath, setTermInfosIndexDivisor, setTextFilterClasses, setTikaConfigPath, setUseCompoundFile, setUseSimpleFSDirectory, setVolatileIdleTimepublic static final String SKIP_VERSION_INDEX_SYSTEM_PROPERTY
public static final boolean SKIP_VERSION_INDEX
public static boolean isAclUuidInIndex(org.apache.jackrabbit.core.query.lucene.SearchIndex index)
true if the supplied SearchIndex implementation has ACL-UUID stored in index.true if the supplied SearchIndex implementation has ACL-UUID stored in indexpublic int getMaxClauseCount()
public void setMaxClauseCount(int maxClauseCount)
public int getBatchSize()
public void setBatchSize(int batchSize)
batchSize - public boolean isAddAclUuidInIndex()
true if ACL-UUID should be resolved and stored in index.
This can have a negative effect on performance, when setting rights on a node,
which has a large subtree using the same rights, as all these nodes will need
to be reindexed. On the other side the advantage is that the queries are faster,
as the user rights are resolved faster.true if ACL-UUID should be resolved and stored in index.public void setAddAclUuidInIndex(boolean addAclUuidInIndex)
public Set<String> getTypesUsingOptimizedACEIndexation()
public void setTypesUsingOptimizedACEIndexation(String typesUsingOptimizedACEIndexation)
public void setIgnoredTypes(String ignoredTypes)
public int getDefaultWaitTime()
public void setDefaultWaitTime(int defaultWaitTime)
protected void doInit()
throws IOException
doInit in class org.apache.jackrabbit.core.query.lucene.SearchIndexIOExceptionprotected org.apache.jackrabbit.core.query.lucene.AnalyzerRegistry getAnalyzerRegistry()
getAnalyzerRegistry in class org.apache.jackrabbit.core.query.lucene.SearchIndexprotected org.apache.jackrabbit.core.query.lucene.IndexingConfiguration createIndexingConfiguration(org.apache.jackrabbit.core.query.lucene.NamespaceMappings namespaceMappings)
createIndexingConfiguration in class org.apache.jackrabbit.core.query.lucene.SearchIndexprotected org.apache.lucene.index.IndexReader getIndexReader(boolean includeSystemIndex)
throws IOException
getIndexReader in class org.apache.jackrabbit.core.query.lucene.SearchIndexIOExceptionpublic void updateNodes(Iterator<org.apache.jackrabbit.core.id.NodeId> remove, Iterator<org.apache.jackrabbit.core.state.NodeState> add) throws javax.jcr.RepositoryException, IOException
updateNodes in interface org.apache.jackrabbit.core.query.QueryHandlerupdateNodes in class org.apache.jackrabbit.core.query.lucene.SearchIndexremove - ids of nodes to remove.add - NodeStates to add. Calls to next() on this
iterator may return null, to indicate that a
node could not be indexed successfully.javax.jcr.RepositoryException - if an error occurs while indexing a node.IOException - if an error occurs while updating the index.protected org.apache.lucene.document.Document createDocument(org.apache.jackrabbit.core.state.NodeState node,
org.apache.jackrabbit.core.query.lucene.NamespaceMappings nsMappings,
org.apache.jackrabbit.core.query.lucene.IndexFormatVersion indexFormatVersion)
throws javax.jcr.RepositoryException
createDocument in class org.apache.jackrabbit.core.query.lucene.SearchIndexjavax.jcr.RepositoryExceptionprotected boolean isNodeExcluded(org.apache.jackrabbit.core.state.NodeState node)
throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic javax.jcr.query.qom.QueryObjectModel createQueryObjectModel(org.apache.jackrabbit.core.session.SessionContext sessionContext,
org.apache.jackrabbit.spi.commons.query.qom.QueryObjectModelTree qomTree,
String language,
javax.jcr.Node node)
throws javax.jcr.RepositoryException
createQueryObjectModel in interface org.apache.jackrabbit.core.query.QueryHandlercreateQueryObjectModel in class org.apache.jackrabbit.core.query.lucene.SearchIndexjavax.jcr.RepositoryExceptionpublic org.apache.jackrabbit.core.query.ExecutableQuery createExecutableQuery(org.apache.jackrabbit.core.session.SessionContext sessionContext,
String statement,
String language)
throws javax.jcr.query.InvalidQueryException
createExecutableQuery in interface org.apache.jackrabbit.core.query.QueryHandlercreateExecutableQuery in class org.apache.jackrabbit.core.query.lucene.SearchIndexjavax.jcr.query.InvalidQueryExceptionpublic Iterable<org.apache.jackrabbit.core.id.NodeId> getWeaklyReferringNodes(org.apache.jackrabbit.core.id.NodeId id) throws javax.jcr.RepositoryException, IOException
getWeaklyReferringNodes in interface org.apache.jackrabbit.core.query.QueryHandlergetWeaklyReferringNodes in class org.apache.jackrabbit.core.query.lucene.SearchIndexjavax.jcr.RepositoryExceptionIOExceptionprotected org.apache.tika.parser.Parser createParser()
createParser in class org.apache.jackrabbit.core.query.lucene.SearchIndexpublic boolean prepareReindexing()
public void scheduleReindexing()
public void reindexTree(String startNodeId) throws javax.jcr.RepositoryException, org.apache.jackrabbit.core.state.NoSuchItemStateException, IllegalArgumentException, org.apache.jackrabbit.core.state.ItemStateException, IOException
startNodeId - the UUID of the node to start re-indexing withjavax.jcr.RepositoryException - if an error occurs while indexing a node.org.apache.jackrabbit.core.state.NoSuchItemStateException - in case of JCR errorsIllegalArgumentException - in case of JCR errorsorg.apache.jackrabbit.core.state.ItemStateException - in case of JCR errorsIOException - if an error occurs while updating the indexpublic org.apache.jackrabbit.core.query.lucene.MultiColumnQueryHits executeQuery(org.apache.jackrabbit.core.SessionImpl session,
org.apache.jackrabbit.core.query.lucene.AbstractQueryImpl queryImpl,
org.apache.lucene.search.Query query,
org.apache.jackrabbit.spi.Path[] orderProps,
boolean[] orderSpecs,
String[] orderFuncs,
long resultFetchHint)
throws IOException
executeQuery in class org.apache.jackrabbit.core.query.lucene.SearchIndexsession - the session that executes the query.queryImpl - the query impl.query - the lucene query.orderProps - name of the properties for sort order.orderSpecs - the order specs for the sort order properties.
true indicates ascending order,
false indicates descending.orderFuncs - functions for the properties for sort order.resultFetchHint - a hint on how many results should be fetched. @return the query hits.IOException - if an error occurs while searching the index.public org.apache.jackrabbit.core.query.lucene.MultiColumnQueryHits executeQuery(org.apache.jackrabbit.core.SessionImpl session,
org.apache.jackrabbit.core.query.lucene.MultiColumnQuery query,
org.apache.jackrabbit.core.query.lucene.Ordering[] orderings,
long resultFetchHint)
throws IOException
executeQuery in class org.apache.jackrabbit.core.query.lucene.SearchIndexsession - the session that executes the query.query - the query.orderings - the order specs for the sort order.resultFetchHint - a hint on how many results should be fetched.IOException - if an error occurs while searching the index.public void switchReadOnlyMode(boolean enable)
Copyright © 2004–2020 Jahia Solutions Group SA. All rights reserved.