Package org.alfresco.service.cmr.search
Interface SearchService
This encapsulates the execution of search against different indexing
mechanisms.
Canned queries have been translated into the query string by this stage.
Handling of parameterisation is left to the implementation.
- Author:
- Andy hind
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
Deprecated.static final String
Deprecated.static final String
Deprecated.static final String
Deprecated.static final String
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Search for string pattern in both the node text (if present) and node propertiesboolean
contains
(NodeRef nodeRef, QName propertyQName, String googleLikePattern, SearchParameters.Operator defaultOperator) Search for string pattern in both the node text (if present) and node propertiesboolean
Search for string pattern in both the node text (if present) and node propertiesSearch against a store.query
(StoreRef store, String language, String query, QueryParameterDefinition[] queryParameterDefinitions) Search against a store.query
(StoreRef store, QName queryId, QueryParameter[] queryParameters) Execute a canned queryquery
(SearchParameters searchParameters) Search using the given SearchParametersselectNodes
(NodeRef contextNodeRef, String xpath, QueryParameterDefinition[] parameters, NamespacePrefixResolver namespacePrefixResolver, boolean followAllParentLinks) Select nodes using an xpath expression.selectNodes
(NodeRef contextNodeRef, String xpath, QueryParameterDefinition[] parameters, NamespacePrefixResolver namespacePrefixResolver, boolean followAllParentLinks, String language) Select nodes using an xpath expression.selectProperties
(NodeRef contextNodeRef, String xpath, QueryParameterDefinition[] parameters, NamespacePrefixResolver namespacePrefixResolver, boolean followAllParentLinks) Select properties using an xpath expressionselectProperties
(NodeRef contextNodeRef, String xpath, QueryParameterDefinition[] parameters, NamespacePrefixResolver namespacePrefixResolver, boolean followAllParentLinks, String language) Select properties using an xpath expression
-
Field Details
-
LANGUAGE_LUCENE
- See Also:
-
LANGUAGE_XPATH
- See Also:
-
LANGUAGE_FTS_ALFRESCO
- See Also:
-
LANGUAGE_CMIS_STRICT
- See Also:
-
LANGUAGE_CMIS_ALFRESCO
- See Also:
-
LANGUAGE_INDEX_CMIS
- See Also:
-
LANGUAGE_INDEX_ALFRESCO
- See Also:
-
LANGUAGE_INDEX_SQL
- See Also:
-
LANGUAGE_INDEX_FTS_ALFRESCO
- See Also:
-
LANGUAGE_SOLR_FTS_ALFRESCO
Deprecated.- See Also:
-
LANGUAGE_SOLR_CMIS
Deprecated.- See Also:
-
LANGUAGE_SOLR_ALFRESCO
Deprecated.- See Also:
-
LANGUAGE_SOLR_SQL
Deprecated.- See Also:
-
-
Method Details
-
query
@Auditable(parameters={"store","language","query"}) ResultSet query(StoreRef store, String language, String query) Search against a store. Pulls back all attributes on each node. Does not allow parameterisation.- Parameters:
store
- - the store against which to searchlanguage
- - the query languagequery
- - the query string - which may include parameters- Returns:
- Returns the query results
-
query
@Auditable(parameters={"store","language","query","queryParameterDefinitions"}) ResultSet query(StoreRef store, String language, String query, QueryParameterDefinition[] queryParameterDefinitions) Search against a store.- Parameters:
store
- - the store against which to searchlanguage
- - the query languagequery
- - the query string - which may include parametersqueryParameterDefinitions
- - query parameter definitions - the default value is used for the value.- Returns:
- Returns the query results
-
query
@Auditable(parameters={"store","queryId","queryParameters"}) ResultSet query(StoreRef store, QName queryId, QueryParameter[] queryParameters) Execute a canned query- Parameters:
store
- - the store against which to searchqueryId
- - the query identifierqueryParameters
- - parameterisation for the canned query- Returns:
- Returns the query results
-
query
Search using the given SearchParameters -
selectNodes
@Auditable(parameters={"contextNodeRef","xpath","parameters","namespacePrefixResolver","followAllParentLinks"}, recordable={true,true,true,false,true}) List<NodeRef> selectNodes(NodeRef contextNodeRef, String xpath, QueryParameterDefinition[] parameters, NamespacePrefixResolver namespacePrefixResolver, boolean followAllParentLinks) throws InvalidNodeRefException, XPathException Select nodes using an xpath expression.- Parameters:
contextNodeRef
- - the context node for relative expressions etcxpath
- - the xpath string to evaluateparameters
- - parameters to bind in to the xpath expression, may be null for no parametersnamespacePrefixResolver
- - prefix to namespace mappingsfollowAllParentLinks
- - if false ".." follows only the primary parent links, if true it follows all- Returns:
- a list of the node refs of the selected nodes
- Throws:
InvalidNodeRefException
XPathException
-
selectNodes
@Auditable(parameters={"contextNodeRef","xpath","parameters","namespacePrefixResolver","followAllParentLinks","language"}, recordable={true,true,true,false,true,true}) List<NodeRef> selectNodes(NodeRef contextNodeRef, String xpath, QueryParameterDefinition[] parameters, NamespacePrefixResolver namespacePrefixResolver, boolean followAllParentLinks, String language) throws InvalidNodeRefException, XPathException Select nodes using an xpath expression.- Parameters:
contextNodeRef
- - the context node for relative expressions etcxpath
- - the xpath string to evaluateparameters
- - parameters to bind in to the xpath expression, may be null for no parametersnamespacePrefixResolver
- - prefix to namespace mappingsfollowAllParentLinks
- - if false ".." follows only the primary parent links, if true it follows alllanguage
- - the xpath variant- Returns:
- a list of all the node refs of the selected nodes
- Throws:
InvalidNodeRefException
XPathException
-
selectProperties
@Auditable(parameters={"contextNodeRef","xpath","parameters","namespacePrefixResolver","followAllParentLinks"}, recordable={true,true,true,false,true}) List<Serializable> selectProperties(NodeRef contextNodeRef, String xpath, QueryParameterDefinition[] parameters, NamespacePrefixResolver namespacePrefixResolver, boolean followAllParentLinks) throws InvalidNodeRefException, XPathException Select properties using an xpath expression- Parameters:
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- Returns:
- a list of property values
- Throws:
InvalidNodeRefException
XPathException
-
selectProperties
@Auditable(parameters={"contextNodeRef","xpath","parameters","namespacePrefixResolver","followAllParentLinks","language"}, recordable={true,true,true,false,true,true}) List<Serializable> selectProperties(NodeRef contextNodeRef, String xpath, QueryParameterDefinition[] parameters, NamespacePrefixResolver namespacePrefixResolver, boolean followAllParentLinks, String language) throws InvalidNodeRefException, XPathException Select properties using an xpath expression- Parameters:
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 alllanguage
- - the xpath variant- Returns:
- a list of property values
- Throws:
InvalidNodeRefException
XPathException
-
contains
@Auditable(parameters={"nodeRef","propertyQName","googleLikePattern"}) boolean contains(NodeRef nodeRef, QName propertyQName, String googleLikePattern) throws InvalidNodeRefException Search for string pattern in both the node text (if present) and node properties- Parameters:
nodeRef
- the node to getpropertyQName
- the name of the propertygoogleLikePattern
- a Google-like pattern to search for in the property value- Returns:
- Returns true if the pattern could be found - uses the default OR operator
- Throws:
InvalidNodeRefException
-
contains
@Auditable(parameters={"nodeRef","propertyQName","googleLikePattern","defaultOperator"}) boolean contains(NodeRef nodeRef, QName propertyQName, String googleLikePattern, SearchParameters.Operator defaultOperator) throws InvalidNodeRefException Search for string pattern in both the node text (if present) and node properties- Parameters:
nodeRef
- the node to getpropertyQName
- the name of the propertygoogleLikePattern
- a Google-like pattern to search for in the property value- Returns:
- Returns true if the pattern could be found
- Throws:
InvalidNodeRefException
-
like
@Auditable(parameters={"nodeRef","propertyQName","sqlLikePattern","includeFTS"}) boolean like(NodeRef nodeRef, QName propertyQName, String sqlLikePattern, boolean includeFTS) throws InvalidNodeRefException Search for string pattern in both the node text (if present) and node properties- Parameters:
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- Returns:
- Returns true if the pattern could be found
- Throws:
InvalidNodeRefException
-