com.raritantechnologies.verity
Class VerityQueryProcessor

java.lang.Object
  extended bycom.raritantechnologies.verity.VerityQueryProcessor
All Implemented Interfaces:
IQueryProcessor

public class VerityQueryProcessor
extends java.lang.Object
implements IQueryProcessor

Implementation of IQueryProcessor that executes a search on a Verity K2 server.

Uses a VeritySearchSource to configure the search and result parameters for a specific Verity collection and an IQueryCooker to format the Verity Query Language (VQL) query. VerityQueryMananger is used to execute the query.


Developed by Raritan Technologies .

Author:
Ted Sullivan, Glenn Robitaille

Field Summary
protected  IQueryCooker queryCooker
           
 
Constructor Summary
VerityQueryProcessor()
           
VerityQueryProcessor(IQueryCooker qCooker)
           
 
Method Summary
 IResultSet executeQuery(java.lang.Integer queryID, ISearchFieldMap searchMap, SourceLoginInfo[] sources, OrderedMap inputParameters, java.lang.Integer pageSize, java.lang.Integer startRec)
          Checks if the inputParameters have been searched.
static java.lang.String[] getCollections(java.lang.String sourceName)
          returns the set of K2 collections for the given SearchSource
static java.lang.String getK2ServerSpec(SourceLoginInfo source)
          returns the k2 server specifications K2BrokerDNS:port for the given Verity SearchSource
 int getMaxDocCount(SourceLoginInfo[] sources, int pageSize, int startRec)
          returns the Maximum Doc Count
 IQueryCooker getQueryCooker()
           
 void setPageSize(int pageSize)
           
 void setQueryCooker(IQueryCooker qCooker)
           
 void setStartRec(int startRec)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

queryCooker

protected IQueryCooker queryCooker
Constructor Detail

VerityQueryProcessor

public VerityQueryProcessor()

VerityQueryProcessor

public VerityQueryProcessor(IQueryCooker qCooker)
Method Detail

setQueryCooker

public void setQueryCooker(IQueryCooker qCooker)

getQueryCooker

public IQueryCooker getQueryCooker()

setStartRec

public void setStartRec(int startRec)

setPageSize

public void setPageSize(int pageSize)

executeQuery

public IResultSet executeQuery(java.lang.Integer queryID,
                               ISearchFieldMap searchMap,
                               SourceLoginInfo[] sources,
                               OrderedMap inputParameters,
                               java.lang.Integer pageSize,
                               java.lang.Integer startRec)
                        throws QueryProcessorException

Checks if the inputParameters have been searched. Can reuse the VerityQueryManager so that its associated VSearch object is reused.

Cooks the parameters into VQL using the queryCooker Sends the VQL string through the VerityQueryManager

Specified by:
executeQuery in interface IQueryProcessor
Parameters:
queryID - Unique ID for this query. Used by front end to manage queries and query pages. QueryProcessor may use this parameter to organize its search results, and to organize any state information it needs to process future page requests (future executeQuery( ) calls with the same queryID.
searchMap - Provides mapping information needed to translate the inputParameters into a search string appropriate for this type of QueryProcessor. Mapping information is obtained by the application framework from local configuration data.
sources - The LoginInfo and SearchSource(s) to be used for this query. The SearchSource(s) must be of the appropriate type for the QueryProcessor.
inputParameters - Form inputs. Use ISearchFieldMap to translate these into implementation and source-specific fields.
pageSize - Integer specifying the number of results to include in the returned Document. if null - use the default page size.
startRec - Integer specifying the starting record in the result set to be returned. if null - start with the first record.
Returns:
IResultSet containing result set.
Throws:
QueryException
QueryProcessorException

getK2ServerSpec

public static java.lang.String getK2ServerSpec(SourceLoginInfo source)
returns the k2 server specifications K2BrokerDNS:port for the given Verity SearchSource


getCollections

public static java.lang.String[] getCollections(java.lang.String sourceName)
returns the set of K2 collections for the given SearchSource


getMaxDocCount

public int getMaxDocCount(SourceLoginInfo[] sources,
                          int pageSize,
                          int startRec)
returns the Maximum Doc Count