com.raritantechnologies.verity
Class RulesQueryCooker

java.lang.Object
  extended bycom.raritantechnologies.verity.RulesQueryCooker
All Implemented Interfaces:
IQueryCooker

public class RulesQueryCooker
extends java.lang.Object
implements IQueryCooker

Rules Verity QueryCooker Implementation - applies rules to a query read from the configuration file.

The Config XML fragment should be inside a Verity or Parametric SearchSource.

XML Configuration Template:
 <QueryCooker class="com.raritantechnologies.verity.RulesQueryCooker"
   queryParam="query"
   [ showQuery="false" ]
   [ rulesFile="ExternalRulesFile.xml" ]
   [ rulesName="UniqueRulesName" ]
   [ rulesClassName="com.raritantechnologies.vqlparser.XMLQueryRules" ] >
 { the following is only present if rulesFile was not specified }
		<Rules>
			<Rule group="A" op=" field="ALL" wordMin="0" wordMax="5" id="1">
					query
			</Rule>
			...
		</Rules>
 <QueryCooker />
 

Developed by Raritan Technologies .

Author:
Kepler Gelotte

Constructor Summary
RulesQueryCooker()
           
RulesQueryCooker(java.lang.String queryParam)
           
 
Method Summary
 java.lang.String getHighlightQuery(java.lang.String[] searchSources, OrderedMap queryParams, ISearchFieldMap searchMap, ILoginInfo userInfo)
          returns a query suitable for use with Verity highlighting processes.
 java.lang.String getSourceQuery(java.lang.String[] searchSources, OrderedMap queryParams, ISearchFieldMap searchMap, ILoginInfo userInfo)
          returns a Verity Query Language (VQL) Source Query.
 java.lang.String getVerityQuery(java.lang.String[] searchSources, OrderedMap queryParams, ISearchFieldMap searchMap, ILoginInfo userInfo)
          returns a Verity Query Language (VQL) string for the form parameters submitted in queryParams.
 void initialize(org.w3c.dom.Element elem)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RulesQueryCooker

public RulesQueryCooker()

RulesQueryCooker

public RulesQueryCooker(java.lang.String queryParam)
Method Detail

getVerityQuery

public java.lang.String getVerityQuery(java.lang.String[] searchSources,
                                       OrderedMap queryParams,
                                       ISearchFieldMap searchMap,
                                       ILoginInfo userInfo)
Description copied from interface: IQueryCooker
returns a Verity Query Language (VQL) string for the form parameters submitted in queryParams. The Search sources are needed to map the input params to the verity collection fields. This mapping can be different for different search sources.

Specified by:
getVerityQuery in interface IQueryCooker

getSourceQuery

public java.lang.String getSourceQuery(java.lang.String[] searchSources,
                                       OrderedMap queryParams,
                                       ISearchFieldMap searchMap,
                                       ILoginInfo userInfo)
Description copied from interface: IQueryCooker
returns a Verity Query Language (VQL) Source Query.

Specified by:
getSourceQuery in interface IQueryCooker

getHighlightQuery

public java.lang.String getHighlightQuery(java.lang.String[] searchSources,
                                          OrderedMap queryParams,
                                          ISearchFieldMap searchMap,
                                          ILoginInfo userInfo)
Description copied from interface: IQueryCooker
returns a query suitable for use with Verity highlighting processes.

Specified by:
getHighlightQuery in interface IQueryCooker

initialize

public void initialize(org.w3c.dom.Element elem)
Specified by:
initialize in interface IQueryCooker