lumis.search
Class SearchContext

Package class diagram package SearchContext
java.lang.Object
  extended by lumis.search.SearchContext

public abstract class SearchContext
extends Object

Context for search infrastructure, that gives access to search configuration.

The class must be initialized before being called.

Since:
4.0.4

Constructor Summary
SearchContext()
           
 
Method Summary
static Node getCriteriaNode(String criteriaId)
          Returns the criteria node for a content criteria, which is used to check certain criteria against a SearchContent and eventually use a configuration defined specifically to this criteria.
static Node getIndexerConfigNode(String searchEngineId, String indexerId)
          Returns the configuration node for one of the search engine's indexers.
static Node[] getIndexerConfigNodes(String searchEngineId)
          Returns the configuration nodes for all indexers of a search engine.
static Node getSearchEngineConfigNode(String searchEngineId)
          Returns the configuration node for the a search engine.
static Node getSearcherConfigNode(String searchEngineId, String searcherId)
          Returns the configuration node for one of the search engine's searchers.
static Node[] getSearcherConfigNodes(String searchEngineId)
          Returns the configuration nodes for all searchers of a search engine.
static void init(String searchConfigPath)
          Initialize the search context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearchContext

public SearchContext()
Method Detail

init

public static void init(String searchConfigPath)
                 throws PortalException
Initialize the search context. This method reads and cache the search configuration, present in the file searchconfig.xml.

This method must be callled once before calls to any other method can be made, or a SearchException will be thrown.

Parameters:
searchConfigPath - path to the configuration file searchconfig.xml.
Throws:
PortalException
Since:
4.0.4

getSearchEngineConfigNode

public static Node getSearchEngineConfigNode(String searchEngineId)
                                      throws PortalException
Returns the configuration node for the a search engine.

If the search engine was not specified (passing null as argument), the default search engine will be used (which is the first declared in the configuration file).

Parameters:
searchEngineId - search engine identifier, or null for the default search engine
Returns:
configuration node for the search engine
Throws:
PortalException - if the context was not initialized or the given search engine was not found in the configuration.
Since:
4.0.4

getIndexerConfigNode

public static Node getIndexerConfigNode(String searchEngineId,
                                        String indexerId)
                                 throws PortalException
Returns the configuration node for one of the search engine's indexers.

If the search engine was not specified (passing null as argument), the default search engine will be used (which is the first declared in the configuration file).

If the indexer was not specified (passing null as argument), the default indexer will be used (which is the first declared in the search engine configuration).

Parameters:
searchEngineId - search engine identifier, or null for the default search engine
indexerId - indexer identifier, or null for the default indexer of the search engine
Returns:
configuration node for the indexer
Throws:
PortalException - if the context was not initialized or the given search engine or the indexer was not found in the configuration.
Since:
4.0.4

getIndexerConfigNodes

public static Node[] getIndexerConfigNodes(String searchEngineId)
                                    throws PortalException
Returns the configuration nodes for all indexers of a search engine.

Parameters:
searchEngineId - search engine identifier, or null for the default search engine
Returns:
configuration nodes for the indexers
Throws:
PortalException - if the context was not initialized or the given search engine was not found in the configuration.
Since:
4.0.4

getSearcherConfigNode

public static Node getSearcherConfigNode(String searchEngineId,
                                         String searcherId)
                                  throws PortalException
Returns the configuration node for one of the search engine's searchers.

If the search engine was not specified (passing null as argument), the default search engine will be used (which is the first declared in the configuration file).

If the searcher was not specified (passing null as argument), the default searcher will be used (which is the first declared in the search engine configuration).

Parameters:
searchEngineId - search engine identifier, or null for the default search engine
searcherId - searcher identifier, or null for the default searcher of the search engine
Returns:
configuration node for the searcher
Throws:
PortalException - if the context was not initialized or the given search engine or the searcher was not found in the configuration.
Since:
4.0.4

getSearcherConfigNodes

public static Node[] getSearcherConfigNodes(String searchEngineId)
                                     throws PortalException
Returns the configuration nodes for all searchers of a search engine.

Parameters:
searchEngineId - search engine identifier, or null for the default search engine
Returns:
configuration nodes for the searchers
Throws:
PortalException - if the context was not initialized or the given search engine was not found in the configuration.
Since:
4.0.4

getCriteriaNode

public static Node getCriteriaNode(String criteriaId)
                            throws PortalException
Returns the criteria node for a content criteria, which is used to check certain criteria against a SearchContent and eventually use a configuration defined specifically to this criteria.

Parameters:
criteriaId - criteria identification
Returns:
criteria node
Throws:
PortalException
Since:
4.0.4


Lumisportal  6.2.0.120405 - Copyright © 2006–2012 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.