Package org.alfresco.solr
Class SolrInformationServer
java.lang.Object
org.alfresco.solr.SolrInformationServer
- All Implemented Interfaces:
InformationServer,org.alfresco.solr.InformationServerCollectionProvider
This is the Apache Solr implementation of the information server (index).
- Since:
- 5.0
- Author:
- Ahmed Owian
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final StringShared property to determine if the cascade tracking is enabled.static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from interface org.alfresco.solr.InformationServer
PROP_PREFIX_PARENT_ASPECT, PROP_PREFIX_PARENT_TYPE -
Constructor Summary
ConstructorsConstructorDescriptionSolrInformationServer(AlfrescoCoreAdminHandler adminHandler, org.apache.solr.core.SolrCore core, org.alfresco.solr.client.SOLRAPIClient repositoryClient) -
Method Summary
Modifier and TypeMethodDescriptionbooleanaclChangeSetInIndex(long changeSetId, boolean populateCache) voidaddCommonNodeReportInfo(org.alfresco.solr.NodeReport nodeReport) voidaddContentOutdatedAndUpdatedCounts(org.apache.solr.common.util.NamedList<Object> report) The outdated node are computed counting all nodes that have LATEST_APPLIED_CONTENT_VERSION_ID =</li> <li> DOC_TYPE = {@link #DOC_TYPE_NODE} </li> </ul> The updated nodes are computed by simply subtracting the count above from the total number of documents that represent nodes. However, keep in mind that using the two fields LATEST_APPLIED_CONTENT_VERSION_ID and LAST_INCOMING_CONTENT_VERSION_ID there's another (more expensive) way to compute the same information: the following query should return the same result (i.e. number of updated nodes): <pre> facet.query={!frange key='UPDATED' l=0}sub(LAST_INCOMING_CONTENT_VERSION_ID,LATEST_APPLIED_CONTENT_VERSION_ID) </pre>voidvoidcapIndex(long dbid) voidcascadeNodes(List<org.alfresco.solr.client.NodeMetaData> nodeMetaDatas, boolean overwrite) booleanCheck if cascade tracking is enabled.org.alfresco.solr.AclReportcheckAclInIndex(Long aclid, org.alfresco.solr.AclReport aclReport) voidvoidvoidcommit()booleancommit(boolean openSearcher) voidcontinueState(org.alfresco.solr.TrackerState state) voiddeleteByAclChangeSetId(Long aclChangeSetId) voiddeleteByAclId(Long aclId) voiddeleteByNodeId(Long nodeId) voiddeleteByTransactionId(Long transactionId) voiddirtyTransaction(long txnId) intgetAclTxDocsSize(String aclTxId, String aclTxCommitTime) List<org.alfresco.solr.client.AlfrescoModel>List<org.alfresco.solr.client.NodeMetaData>getCascadeNodes(List<Long> txnIds) List<org.alfresco.solr.client.Transaction>getCascades(int num) org.alfresco.repo.dictionary.DictionaryComponentgetDictionaryService(String alternativeDictionary) intgetDocListSize(String query) longlongorg.alfresco.repo.dictionary.M2ModelgetM2Model(org.alfresco.service.namespace.QName modelQName) org.alfresco.solr.client.AclChangeSetorg.alfresco.solr.client.Transactionorg.alfresco.repo.dictionary.NamespaceDAOorg.alfresco.solr.adapters.IOpenBitSetintgetPort()getProps()int<T> org.alfresco.solr.adapters.ISimpleOrderedMap<T>org.alfresco.solr.TrackerStateorg.alfresco.solr.tracker.TrackerStatsintgetTxDocsSize(String targetTxId, String targetTxCommitTime) voidlongvoidindexAclTransaction(org.alfresco.solr.client.AclChangeSet changeSet, boolean overwrite) voidindexNode(org.alfresco.solr.client.Node node, boolean overwrite) voidindexNodes(List<org.alfresco.solr.client.Node> nodes, boolean overwrite) voidindexTransaction(org.alfresco.solr.client.Transaction info, boolean overwrite) voidbooleanvoidmaintainCap(long dbid) longlonglongbooleanputModel(org.alfresco.repo.dictionary.M2Model model) voidvoidreindexNodeByQuery(String query) org.alfresco.solr.tracker.IndexHealthReportreportAclTransactionsInIndex(Long minAclTxId, org.alfresco.solr.adapters.IOpenBitSet aclTxIdsInDb, long maxAclTxId) org.alfresco.solr.tracker.IndexHealthReportreportIndexTransactions(Long minTxId, org.alfresco.solr.adapters.IOpenBitSet txIdsInDb, long maxTxId) voidrollback()voidsetCleanCascadeTxnFloor(long cleanCascadeTxnFloor) voidsetCleanContentTxnFloor(long cleanContentTxnFloor) booleantxnInIndex(long txnId, boolean populateCache) voidvoidprotected voidupdatePathRelatedFields(org.alfresco.solr.client.NodeMetaData nodeMetaData, org.apache.solr.common.SolrInputDocument doc) voidupdateTransaction(org.alfresco.solr.client.Transaction txn)
-
Field Details
-
AND
- See Also:
-
OR
- See Also:
-
DOC_TYPE_NODE
- See Also:
-
DOC_TYPE_ACL
- See Also:
-
DOC_TYPE_TX
- See Also:
-
DOC_TYPE_ACL_TX
- See Also:
-
SOLR_HOST
- See Also:
-
SOLR_PORT
- See Also:
-
SOLR_BASEURL
- See Also:
-
CASCADE_TRACKER_ENABLED
Shared property to determine if the cascade tracking is enabled.- See Also:
-
UNIT_OF_TIME_YEAR_FIELD_SUFFIX
- See Also:
-
UNIT_OF_TIME_QUARTER_FIELD_SUFFIX
- See Also:
-
UNIT_OF_TIME_MONTH_FIELD_SUFFIX
- See Also:
-
UNIT_OF_TIME_DAY_FIELD_SUFFIX
- See Also:
-
UNIT_OF_TIME_DAY_OF_WEEK_FIELD_SUFFIX
- See Also:
-
UNIT_OF_TIME_DAY_OF_YEAR_FIELD_SUFFIX
- See Also:
-
UNIT_OF_TIME_HOUR_FIELD_SUFFIX
- See Also:
-
UNIT_OF_TIME_MINUTE_FIELD_SUFFIX
- See Also:
-
UNIT_OF_TIME_SECOND_FIELD_SUFFIX
- See Also:
-
-
Constructor Details
-
SolrInformationServer
public SolrInformationServer(AlfrescoCoreAdminHandler adminHandler, org.apache.solr.core.SolrCore core, org.alfresco.solr.client.SOLRAPIClient repositoryClient)
-
-
Method Details
-
getAdminHandler
- Specified by:
getAdminHandlerin interfaceInformationServer
-
cascadeTrackingEnabled
public boolean cascadeTrackingEnabled()Description copied from interface:InformationServerCheck if cascade tracking is enabled.- Specified by:
cascadeTrackingEnabledin interfaceInformationServer- Returns:
- true if cascade tracking is enabled (note that this is the default behaviour if not specified in the properties file).
-
initSkippingDescendantDocs
public void initSkippingDescendantDocs()- Specified by:
initSkippingDescendantDocsin interfaceInformationServer
-
addContentOutdatedAndUpdatedCounts
public void addContentOutdatedAndUpdatedCounts(org.apache.solr.common.util.NamedList<Object> report) The outdated node are computed counting all nodes that have-
LATEST_APPLIED_CONTENT_VERSION_ID =
</li> <li> DOC_TYPE = {@link #DOC_TYPE_NODE} </li> </ul> The updated nodes are computed by simply subtracting the count above from the total number of documents that represent nodes. However, keep in mind that using the two fields LATEST_APPLIED_CONTENT_VERSION_ID and LAST_INCOMING_CONTENT_VERSION_ID there's another (more expensive) way to compute the same information: the following query should return the same result (i.e. number of updated nodes): <pre> facet.query={!frange key='UPDATED' l=0}sub(LAST_INCOMING_CONTENT_VERSION_ID,LATEST_APPLIED_CONTENT_VERSION_ID) </pre>
- Specified by:
addContentOutdatedAndUpdatedCountsin interfaceInformationServer
-
LATEST_APPLIED_CONTENT_VERSION_ID =
-
afterInitModels
public void afterInitModels()- Specified by:
afterInitModelsin interfaceInformationServer
-
checkAclInIndex
public org.alfresco.solr.AclReport checkAclInIndex(Long aclid, org.alfresco.solr.AclReport aclReport) - Specified by:
checkAclInIndexin interfaceInformationServer
-
reportIndexTransactions
public org.alfresco.solr.tracker.IndexHealthReport reportIndexTransactions(Long minTxId, org.alfresco.solr.adapters.IOpenBitSet txIdsInDb, long maxTxId) - Specified by:
reportIndexTransactionsin interfaceInformationServer
-
reportAclTransactionsInIndex
public org.alfresco.solr.tracker.IndexHealthReport reportAclTransactionsInIndex(Long minAclTxId, org.alfresco.solr.adapters.IOpenBitSet aclTxIdsInDb, long maxAclTxId) - Specified by:
reportAclTransactionsInIndexin interfaceInformationServer
-
getDocsWithUncleanContent
- Specified by:
getDocsWithUncleanContentin interfaceInformationServer- Throws:
IOException
-
addCommonNodeReportInfo
public void addCommonNodeReportInfo(org.alfresco.solr.NodeReport nodeReport) - Specified by:
addCommonNodeReportInfoin interfaceInformationServer
-
commit
- Specified by:
commitin interfaceInformationServer- Throws:
IOException
-
hardCommit
- Specified by:
hardCommitin interfaceInformationServer- Throws:
IOException
-
commit
- Specified by:
commitin interfaceInformationServer- Throws:
IOException
-
deleteByAclChangeSetId
- Specified by:
deleteByAclChangeSetIdin interfaceInformationServer- Throws:
IOException
-
deleteByAclId
- Specified by:
deleteByAclIdin interfaceInformationServer- Throws:
IOException
-
deleteByNodeId
- Specified by:
deleteByNodeIdin interfaceInformationServer- Throws:
IOException
-
deleteByTransactionId
- Specified by:
deleteByTransactionIdin interfaceInformationServer- Throws:
IOException
-
getAlfrescoModels
- Specified by:
getAlfrescoModelsin interfaceInformationServer
-
getCoreStats
- Specified by:
getCoreStatsin interfaceInformationServer- Throws:
IOException
-
getDictionaryService
public org.alfresco.repo.dictionary.DictionaryComponent getDictionaryService(String alternativeDictionary) - Specified by:
getDictionaryServicein interfaceInformationServer
-
getTxDocsSize
- Specified by:
getTxDocsSizein interfaceInformationServer
-
getAclTxDocsSize
- Specified by:
getAclTxDocsSizein interfaceInformationServer
-
getErrorDocIds
- Specified by:
getErrorDocIdsin interfaceInformationServer- Throws:
IOException
-
getHoleRetention
public long getHoleRetention()- Specified by:
getHoleRetentionin interfaceInformationServer
-
getM2Model
public org.alfresco.repo.dictionary.M2Model getM2Model(org.alfresco.service.namespace.QName modelQName) - Specified by:
getM2Modelin interfaceInformationServer
-
getModelErrors
- Specified by:
getModelErrorsin interfaceInformationServer
-
getNamespaceDAO
public org.alfresco.repo.dictionary.NamespaceDAO getNamespaceDAO()- Specified by:
getNamespaceDAOin interfaceInformationServer
-
getOpenBitSetInstance
public org.alfresco.solr.adapters.IOpenBitSet getOpenBitSetInstance()- Specified by:
getOpenBitSetInstancein interfaceorg.alfresco.solr.InformationServerCollectionProvider
-
getRegisteredSearcherCount
public int getRegisteredSearcherCount()- Specified by:
getRegisteredSearcherCountin interfaceInformationServer
-
getSimpleOrderedMapInstance
public <T> org.alfresco.solr.adapters.ISimpleOrderedMap<T> getSimpleOrderedMapInstance()- Specified by:
getSimpleOrderedMapInstancein interfaceorg.alfresco.solr.InformationServerCollectionProvider
-
getTrackerStats
public org.alfresco.solr.tracker.TrackerStats getTrackerStats()- Specified by:
getTrackerStatsin interfaceInformationServer
-
getTrackerInitialState
public org.alfresco.solr.TrackerState getTrackerInitialState()- Specified by:
getTrackerInitialStatein interfaceInformationServer
-
continueState
public void continueState(org.alfresco.solr.TrackerState state) - Specified by:
continueStatein interfaceInformationServer
-
indexAcl
public long indexAcl(List<org.alfresco.solr.client.AclReaders> aclReaderList, boolean overwrite) throws IOException - Specified by:
indexAclin interfaceInformationServer- Throws:
IOException
-
indexAclTransaction
public void indexAclTransaction(org.alfresco.solr.client.AclChangeSet changeSet, boolean overwrite) throws IOException - Specified by:
indexAclTransactionin interfaceInformationServer- Throws:
IOException
-
getMaxAclChangeSetIdAndCommitTimeInIndex
public org.alfresco.solr.client.AclChangeSet getMaxAclChangeSetIdAndCommitTimeInIndex()- Specified by:
getMaxAclChangeSetIdAndCommitTimeInIndexin interfaceInformationServer
-
dirtyTransaction
public void dirtyTransaction(long txnId) - Specified by:
dirtyTransactionin interfaceInformationServer
-
capIndex
- Specified by:
capIndexin interfaceInformationServer- Throws:
IOException
-
maintainCap
- Specified by:
maintainCapin interfaceInformationServer- Throws:
IOException
-
nodeCount
public long nodeCount()- Specified by:
nodeCountin interfaceInformationServer
-
maxNodeId
public long maxNodeId()- Specified by:
maxNodeIdin interfaceInformationServer
-
minNodeId
public long minNodeId()- Specified by:
minNodeIdin interfaceInformationServer
-
getIndexCap
public long getIndexCap()- Specified by:
getIndexCapin interfaceInformationServer
-
indexNode
public void indexNode(org.alfresco.solr.client.Node node, boolean overwrite) throws IOException, org.json.JSONException - Specified by:
indexNodein interfaceInformationServer- Throws:
IOExceptionorg.json.JSONException
-
getCascadeNodes
public List<org.alfresco.solr.client.NodeMetaData> getCascadeNodes(List<Long> txnIds) throws IOException, org.json.JSONException - Specified by:
getCascadeNodesin interfaceInformationServer- Throws:
IOExceptionorg.json.JSONException
-
cascadeNodes
public void cascadeNodes(List<org.alfresco.solr.client.NodeMetaData> nodeMetaDatas, boolean overwrite) throws IOException, org.json.JSONException - Specified by:
cascadeNodesin interfaceInformationServer- Throws:
IOExceptionorg.json.JSONException
-
updateContent
- Specified by:
updateContentin interfaceInformationServer- Throws:
Exception
-
indexNodes
public void indexNodes(List<org.alfresco.solr.client.Node> nodes, boolean overwrite) throws IOException, org.json.JSONException - Specified by:
indexNodesin interfaceInformationServer- Throws:
IOExceptionorg.json.JSONException
-
updateTransaction
- Specified by:
updateTransactionin interfaceInformationServer- Throws:
IOException
-
indexTransaction
public void indexTransaction(org.alfresco.solr.client.Transaction info, boolean overwrite) throws IOException - Specified by:
indexTransactionin interfaceInformationServer- Throws:
IOException
-
getMaxTransactionIdAndCommitTimeInIndex
public org.alfresco.solr.client.Transaction getMaxTransactionIdAndCommitTimeInIndex()- Specified by:
getMaxTransactionIdAndCommitTimeInIndexin interfaceInformationServer
-
isInIndex
- Specified by:
isInIndexin interfaceInformationServer
-
getCascades
- Specified by:
getCascadesin interfaceInformationServer- Throws:
IOException
-
txnInIndex
- Specified by:
txnInIndexin interfaceInformationServer- Throws:
IOException
-
aclChangeSetInIndex
- Specified by:
aclChangeSetInIndexin interfaceInformationServer- Throws:
IOException
-
clearProcessedTransactions
public void clearProcessedTransactions()- Specified by:
clearProcessedTransactionsin interfaceInformationServer
-
clearProcessedAclChangeSets
public void clearProcessedAclChangeSets()- Specified by:
clearProcessedAclChangeSetsin interfaceInformationServer
-
putModel
public boolean putModel(org.alfresco.repo.dictionary.M2Model model) - Specified by:
putModelin interfaceInformationServer
-
rollback
- Specified by:
rollbackin interfaceInformationServer- Throws:
IOException
-
registerTrackerThread
public void registerTrackerThread()- Specified by:
registerTrackerThreadin interfaceInformationServer
-
unregisterTrackerThread
public void unregisterTrackerThread()- Specified by:
unregisterTrackerThreadin interfaceInformationServer
-
reindexNodeByQuery
- Specified by:
reindexNodeByQueryin interfaceInformationServer- Throws:
IOExceptionorg.json.JSONException
-
getBaseUrl
- Specified by:
getBaseUrlin interfaceInformationServer
-
getPort
public int getPort()- Specified by:
getPortin interfaceInformationServer
-
getHostName
- Specified by:
getHostNamein interfaceInformationServer
-
setCleanContentTxnFloor
public void setCleanContentTxnFloor(long cleanContentTxnFloor) - Specified by:
setCleanContentTxnFloorin interfaceInformationServer
-
setCleanCascadeTxnFloor
public void setCleanCascadeTxnFloor(long cleanCascadeTxnFloor) - Specified by:
setCleanCascadeTxnFloorin interfaceInformationServer
-
getProps
-
updatePathRelatedFields
protected void updatePathRelatedFields(org.alfresco.solr.client.NodeMetaData nodeMetaData, org.apache.solr.common.SolrInputDocument doc) -
getDocListSize
-