org.alfresco.repo.search
Class SearcherComponent

java.lang.Object
  extended by org.alfresco.repo.search.AbstractSearcherComponent
      extended by org.alfresco.repo.search.SearcherComponent
All Implemented Interfaces:
SearchService

public class SearcherComponent
extends AbstractSearcherComponent

Component API for searching. Delegates to the real searcher from the SearcherComponent.indexerAndSearcherFactory. Transactional support is free.


Field Summary
 
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
SearcherComponent()
           
 
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
 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, QueryParameterDefinition[] queryParameterDefinitions)
          Search against a store.
 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, java.lang.String language)
          Select properties using an xpath expression
 void setIndexerAndSearcherFactory(IndexerAndSearcher indexerAndSearcherFactory)
           
 
Methods inherited from class org.alfresco.repo.search.AbstractSearcherComponent
query, selectNodes, selectProperties, translateQuery
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearcherComponent

public SearcherComponent()
Method Detail

setIndexerAndSearcherFactory

public void setIndexerAndSearcherFactory(IndexerAndSearcher indexerAndSearcherFactory)

query

public ResultSet query(StoreRef store,
                       QName queryId,
                       QueryParameter[] queryParameters)
Description copied from interface: SearchService
Execute a canned query

Parameters:
store - - the store against which to search
queryId - - the query identifier
queryParameters - - parameterisation for the canned query
Returns:
Returns the query results

query

public ResultSet query(StoreRef store,
                       java.lang.String language,
                       java.lang.String query,
                       QueryParameterDefinition[] queryParameterDefinitions)
Description copied from interface: SearchService
Search against a store.

Parameters:
store - - the store against which to search
language - - the query language
query - - the query string - which may include parameters
Returns:
Returns the query results

query

public ResultSet query(SearchParameters searchParameters)
Description copied from interface: SearchService
Search using the given SearchParameters


contains

public boolean contains(NodeRef nodeRef,
                        QName propertyQName,
                        java.lang.String googleLikePattern)
                 throws InvalidNodeRefException
Description copied from interface: SearchService
Search for string pattern in both the node text (if present) and node properties

Parameters:
nodeRef - the node to get
propertyQName - the name of the property
googleLikePattern - 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

public boolean contains(NodeRef nodeRef,
                        QName propertyQName,
                        java.lang.String googleLikePattern,
                        SearchParameters.Operator defaultOperator)
                 throws InvalidNodeRefException
Description copied from interface: SearchService
Search for string pattern in both the node text (if present) and node properties

Parameters:
nodeRef - the node to get
propertyQName - the name of the property
googleLikePattern - a Google-like pattern to search for in the property value
Returns:
Returns true if the pattern could be found
Throws:
InvalidNodeRefException

like

public boolean like(NodeRef nodeRef,
                    QName propertyQName,
                    java.lang.String sqlLikePattern,
                    boolean includeFTS)
             throws InvalidNodeRefException
Description copied from interface: SearchService
Search for string pattern in both the node text (if present) and node properties

Parameters:
nodeRef - the node to get
propertyQName - the name of the property (mandatory)
sqlLikePattern - a SQL-like pattern to search for
includeFTS - - include full text search matches in the like test
Returns:
Returns true if the pattern could be found
Throws:
InvalidNodeRefException

selectNodes

public java.util.List selectNodes(NodeRef contextNodeRef,
                                  java.lang.String xpath,
                                  QueryParameterDefinition[] parameters,
                                  NamespacePrefixResolver namespacePrefixResolver,
                                  boolean followAllParentLinks,
                                  java.lang.String language)
                           throws InvalidNodeRefException,
                                  XPathException
Description copied from interface: SearchService
Select nodes using an xpath expression.

Parameters:
contextNodeRef - - the context node for relative expressions etc
xpath - - the xpath string to evaluate
parameters - - parameters to bind in to the xpath expression
namespacePrefixResolver - - prefix to namespace mappings
followAllParentLinks - - if false ".." follows only the primary parent links, if true it follows all
Returns:
a list of all the child assoc relationships to the selected nodes
Throws:
InvalidNodeRefException
XPathException

selectProperties

public java.util.List selectProperties(NodeRef contextNodeRef,
                                       java.lang.String xpath,
                                       QueryParameterDefinition[] parameters,
                                       NamespacePrefixResolver namespacePrefixResolver,
                                       boolean followAllParentLinks,
                                       java.lang.String language)
                                throws InvalidNodeRefException,
                                       XPathException
Description copied from interface: SearchService
Select properties using an xpath expression

Parameters:
contextNodeRef - - the context node for relative expressions etc
xpath - - the xpath string to evaluate
parameters - - parameters to bind in to the xpath expression
namespacePrefixResolver - - prefix to namespace mappings
followAllParentLinks - - if false ".." follows only the primary parent links, if true it follows all
Returns:
a list of property values
Throws:
InvalidNodeRefException
XPathException


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.