|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.alfresco.repo.search.impl.lucene.AbstractLuceneBase
org.alfresco.repo.search.impl.lucene.ADMLuceneSearcherImpl
public class ADMLuceneSearcherImpl
The Lucene implementation of Searcher At the moment we support only lucene based queries. TODO: Support for other query languages
Field Summary |
---|
Fields inherited from class org.alfresco.repo.search.impl.lucene.AbstractLuceneBase |
---|
deltaId, store |
Fields inherited from interface org.alfresco.service.cmr.search.SearchService |
---|
LANGUAGE_CMIS_ALFRESCO, LANGUAGE_CMIS_STRICT, LANGUAGE_FTS_ALFRESCO, LANGUAGE_JCR_XPATH, LANGUAGE_LUCENE, LANGUAGE_XPATH |
Constructor Summary | |
---|---|
ADMLuceneSearcherImpl()
|
Method Summary | |
---|---|
boolean |
contains(NodeRef nodeRef,
QName propertyQName,
java.lang.String googleLikePattern)
Search for string pattern in both the node text (if present) and node properties |
boolean |
contains(NodeRef nodeRef,
QName propertyQName,
java.lang.String googleLikePattern,
SearchParameters.Operator defaultOperator)
Search for string pattern in both the node text (if present) and node properties |
static boolean |
fieldHasTerm(org.apache.lucene.index.IndexReader indexReader,
java.lang.String field)
|
ClosingIndexSearcher |
getClosingIndexSearcher()
Get a lucene searcher |
NamespacePrefixResolver |
getNamespacePrefixResolver()
|
static ADMLuceneSearcherImpl |
getNodeSearcher()
Get a select-node-based searcher |
NodeService |
getNodeService()
|
QueryRegisterComponent |
getQueryRegister()
|
static ADMLuceneSearcherImpl |
getSearcher(StoreRef storeRef,
LuceneConfig config)
Get an intialised searcher for the store. |
static ADMLuceneSearcherImpl |
getSearcher(StoreRef storeRef,
LuceneIndexer indexer,
LuceneConfig config)
Get an initialised searcher for the store and transaction Normally we do not search against a a store and delta. |
TenantService |
getTenantService()
|
java.util.List |
getTopTerms(java.lang.String field,
int count)
Get top terms |
boolean |
indexExists()
Check if the index exists |
boolean |
like(NodeRef nodeRef,
QName propertyQName,
java.lang.String sqlLikePattern,
boolean includeFTS)
Search for string pattern in both the node text (if present) and node properties |
ResultSet |
query(SearchParameters searchParameters)
Search using the given SearchParameters |
ResultSet |
query(StoreRef store,
QName queryId,
QueryParameter[] queryParameters)
Execute a canned query |
ResultSet |
query(StoreRef store,
java.lang.String language,
java.lang.String query)
Search against a store. |
ResultSet |
query(StoreRef store,
java.lang.String language,
java.lang.String queryString,
QueryParameterDefinition[] queryParameterDefinitions)
Search against a store. |
java.util.List |
selectNodes(NodeRef contextNodeRef,
java.lang.String xpath,
QueryParameterDefinition[] parameters,
NamespacePrefixResolver namespacePrefixResolver,
boolean followAllParentLinks)
Select nodes using an xpath expression. |
java.util.List |
selectNodes(NodeRef contextNodeRef,
java.lang.String xpath,
QueryParameterDefinition[] parameters,
NamespacePrefixResolver namespacePrefixResolver,
boolean followAllParentLinks,
java.lang.String language)
Select nodes using an xpath expression. |
java.util.List |
selectProperties(NodeRef contextNodeRef,
java.lang.String xpath,
QueryParameterDefinition[] parameters,
NamespacePrefixResolver namespacePrefixResolver,
boolean followAllParentLinks)
Select properties using an xpath expression |
java.util.List |
selectProperties(NodeRef contextNodeRef,
java.lang.String xpath,
QueryParameterDefinition[] parameters,
NamespacePrefixResolver namespacePrefixResolver,
boolean followAllParentLinks,
java.lang.String language)
Select properties using an xpath expression |
void |
setNamespacePrefixResolver(NamespacePrefixResolver namespacePrefixResolver)
Set the name space service |
void |
setNodeService(NodeService nodeService)
Ste the node service |
void |
setQueryLanguages(java.util.Map queryLanguages)
|
void |
setQueryRegister(QueryRegisterComponent queryRegister)
Set the query register |
void |
setTenantService(TenantService tenantService)
|
Methods inherited from class org.alfresco.repo.search.impl.lucene.AbstractLuceneBase |
---|
closeDeltaReader, closeDeltaWriter, deleteIndex, doWithWriteLock, getDeltaId, getDeltaReader, getDeltaWriter, getDictionaryService, getLuceneConfig, getReader, getSearcher, getSearcher, getStatus, initialise, saveDelta, setDictionaryService, setInfo, setLuceneConfig, setStatus |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ADMLuceneSearcherImpl()
Method Detail |
---|
public static ADMLuceneSearcherImpl getSearcher(StoreRef storeRef, LuceneIndexer indexer, LuceneConfig config)
storeRef
- indexer
- config
-
public static ADMLuceneSearcherImpl getSearcher(StoreRef storeRef, LuceneConfig config)
storeRef
- config
-
public static ADMLuceneSearcherImpl getNodeSearcher()
public void setNamespacePrefixResolver(NamespacePrefixResolver namespacePrefixResolver)
LuceneSearcher
setNamespacePrefixResolver
in interface LuceneSearcher
public NamespacePrefixResolver getNamespacePrefixResolver()
public NodeService getNodeService()
public TenantService getTenantService()
public QueryRegisterComponent getQueryRegister()
public boolean indexExists()
LuceneSearcher
indexExists
in interface LuceneSearcher
public void setNodeService(NodeService nodeService)
LuceneSearcher
setNodeService
in interface LuceneSearcher
public void setTenantService(TenantService tenantService)
public void setQueryRegister(QueryRegisterComponent queryRegister)
queryRegister
- public void setQueryLanguages(java.util.Map queryLanguages)
public ResultSet query(StoreRef store, java.lang.String language, java.lang.String queryString, QueryParameterDefinition[] queryParameterDefinitions) throws SearcherException
SearchService
query
in interface SearchService
store
- -
the store against which to searchlanguage
- -
the query languagequeryString
- -
the query string - which may include parameters
SearcherException
public ResultSet query(SearchParameters searchParameters)
SearchService
query
in interface SearchService
public static boolean fieldHasTerm(org.apache.lucene.index.IndexReader indexReader, java.lang.String field)
public ResultSet query(StoreRef store, java.lang.String language, java.lang.String query)
SearchService
query
in interface SearchService
store
- -
the store against which to searchlanguage
- -
the query languagequery
- -
the query string - which may include parameters
public ResultSet query(StoreRef store, QName queryId, QueryParameter[] queryParameters)
SearchService
query
in interface SearchService
store
- -
the store against which to searchqueryId
- -
the query identifierqueryParameters
- -
parameterisation for the canned query
public java.util.List selectNodes(NodeRef contextNodeRef, java.lang.String xpath, QueryParameterDefinition[] parameters, NamespacePrefixResolver namespacePrefixResolver, boolean followAllParentLinks, java.lang.String language) throws InvalidNodeRefException, XPathException
SearchService
selectNodes
in interface SearchService
contextNodeRef
- -
the context node for relative expressions etcxpath
- -
the xpath string to evaluateparameters
- -
parameters to bind in to the xpath expressionnamespacePrefixResolver
- -
prefix to namespace mappingsfollowAllParentLinks
- -
if false ".." follows only the primary parent links, if true
it follows all
InvalidNodeRefException
XPathException
NodeSearcher
public java.util.List selectProperties(NodeRef contextNodeRef, java.lang.String xpath, QueryParameterDefinition[] parameters, NamespacePrefixResolver namespacePrefixResolver, boolean followAllParentLinks, java.lang.String language) throws InvalidNodeRefException, XPathException
SearchService
selectProperties
in interface SearchService
contextNodeRef
- -
the context node for relative expressions etcxpath
- -
the xpath string to evaluateparameters
- -
parameters to bind in to the xpath expressionnamespacePrefixResolver
- -
prefix to namespace mappingsfollowAllParentLinks
- -
if false ".." follows only the primary parent links, if true
it follows all
InvalidNodeRefException
XPathException
NodeSearcher
public boolean contains(NodeRef nodeRef, QName propertyQName, java.lang.String googleLikePattern)
SearchService
contains
in interface SearchService
nodeRef
- the node to getpropertyQName
- the name of the propertygoogleLikePattern
- a Google-like pattern to search for in the property value
public boolean contains(NodeRef nodeRef, QName propertyQName, java.lang.String googleLikePattern, SearchParameters.Operator defaultOperator)
SearchService
contains
in interface SearchService
nodeRef
- the node to getpropertyQName
- the name of the propertygoogleLikePattern
- a Google-like pattern to search for in the property value
public boolean like(NodeRef nodeRef, QName propertyQName, java.lang.String sqlLikePattern, boolean includeFTS)
SearchService
like
in interface SearchService
nodeRef
- the node to getpropertyQName
- the name of the property (mandatory)sqlLikePattern
- a SQL-like pattern to search forincludeFTS
- -
include full text search matches in the like test
public java.util.List selectNodes(NodeRef contextNodeRef, java.lang.String xpath, QueryParameterDefinition[] parameters, NamespacePrefixResolver namespacePrefixResolver, boolean followAllParentLinks) throws InvalidNodeRefException, XPathException
SearchService
selectNodes
in interface SearchService
contextNodeRef
- -
the context node for relative expressions etcxpath
- -
the xpath string to evaluateparameters
- -
parameters to bind in to the xpath expressionnamespacePrefixResolver
- -
prefix to namespace mappingsfollowAllParentLinks
- -
if false ".." follows only the primary parent links, if true
it follows all
InvalidNodeRefException
XPathException
public java.util.List selectProperties(NodeRef contextNodeRef, java.lang.String xpath, QueryParameterDefinition[] parameters, NamespacePrefixResolver namespacePrefixResolver, boolean followAllParentLinks) throws InvalidNodeRefException, XPathException
SearchService
selectProperties
in interface SearchService
contextNodeRef
- -
the context node for relative expressions etcxpath
- -
the xpath string to evaluateparameters
- -
parameters to bind in to the xpath expressionnamespacePrefixResolver
- -
prefix to namespace mappingsfollowAllParentLinks
- -
if false ".." follows only the primary parent links, if true
it follows all
InvalidNodeRefException
XPathException
public java.util.List getTopTerms(java.lang.String field, int count)
LuceneSearcher
getTopTerms
in interface LuceneSearcher
public ClosingIndexSearcher getClosingIndexSearcher()
LuceneSearcher
getClosingIndexSearcher
in interface LuceneSearcher
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |