com.raritantechnologies.searchApp.sourceMap
Class LookupSearchSourceFactory

java.lang.Object
  extended bycom.raritantechnologies.searchApp.XMLSearchSourceFactory
      extended bycom.raritantechnologies.searchApp.sourceMap.LookupSearchSourceFactory
All Implemented Interfaces:
IXMLSearchSourceFactory

public class LookupSearchSourceFactory
extends XMLSearchSourceFactory

Factory class for creating LookupSearchSource objects from XML Configuration. A LookupSearchSource provides a lookup service enabling search inputs to a search source to be expanded prior to executing the search on the target SearchSource.

The LookupQueryProcessor can also be used to expand or translate metadata fields in the initial search result output. To use it in this way, set 'addAllInputResults' = true and 'excludeOutputHits' = true

XML Configuration Template:
  <SourceType name="[ search source name ]" 
              type="LookupSearchSource" 
              displayName="[ human readable name ]"
              sourceFactoryClass="com.raritantechnologies.searchApp.sourceMap.LookupSearchSourceFactory"
              queryProcessor="com.raritantechnologies.searchApp.sourceMap.LookupQueryProcessor"
              addAllRequestParams="true(default)|false - if false don't add all initial query parameters to secondary search"
              addAllInputResults="true"
              excludeOutputHits="false"
              addAllInputFields="true|false - if true add input result metadata to output result"
              nestedResultField="[ field name to use to add the entire input result as a nested result ]"
              inputSourcePaging="true|false(default)"
              outputSourcePaging="true(default)|false"
              inputPageSize="[ page size of input result set ]"
              outputPageSize="[ page size of output result set ]" >

   <!-- =================================================================== -->
   <!-- Fields section defines how the results of the first query processor -->
   <!-- are to be used to generate a query to the second query processor    -->
   <!-- and to define fields that are to be combined in the final output.   -->
   <!--                                                                     -->
   <!-- AddToQuery Fields: These are parameters that are to be copied from  -->
   <!-- the initial result to the query used for the second order search.   -->
   <!--                                                                     -->
   <!-- AddToOutput Fields: These are parameters that are to be copied      -->
   <!-- from the initial result to the final output result.                 -->
   <!-- =================================================================== -->
   <Fields>
     <AddToQuery ID="Name" required="true" />
     <AddToQuery ID="OtherName" />
     <AddToQuery ID="query param" value="[ its fixed value ]" />
     <AddToQuery ID="query param" mapTo="[ field name in output source ]" />

     <AddToOutput ID="[ field ID ]" />
     <AddToOutput ID="[ another field ID ]" />
     <AddToOutput ID="STATIC_FIELD" value="ITS VALUE" />
   </Fields>

   <!-- =================================================================== --> 
   <!--     Defines the initial search source used.                         -->
   <!-- =================================================================== --> 
   <InputSource>[ name of initial Search Source ]</InputSource>

   <!-- =================================================================== -->
   <!-- Optional formatting / filtering elements that can be used to modify -->
   <!-- results of the initial search before using these to generate a      -->
   <!-- query to the second source.                                         -->
   <!-- =================================================================== -->
   <InputFormatter class="[ class of com.raritantechnologies.searchApp.IFieldFormatter ]" >
     <!-- configuration parameters for IFieldFormatter -->
   </InputFormatter>

   <!-- Filters the query map generated by the primary search prior to its  -->
   <!-- use in the secondary search.                                        -->
   <MapFilter class="[class of com.raritantechnologies.utils.filter.IMapFilter ]" >
     <!-- configuration parameters for MapFilter -->
   </MapFilter>

   <!-- Filters the query map generated by the primary search prior to its  -->
   <!-- use in the secondary search.                                        -->
   <QueryParser class="[class of com.raritantechnologies.searchApp.IQueryParser ]" >
     <!-- configuration parameters for QueryParser -->
   </MapFilter>

   <!-- =================================================================== --> 
   <!--     Defines the final or output search source use                   -->
   <!-- =================================================================== -->
   <OutputSource>[ name of second Search Source ]</OutputSource>

   <!-- Alternatively - outputSource name is a field value of               -->
   <!-- the initial search result.                                          -->
   <OutputSource isFieldName="true">sourceFieldName</OutputSource>

  </SourceType>
 

Developed by Raritan Technologies .

Author:
Ted Sullivan

Constructor Summary
LookupSearchSourceFactory()
           
 
Method Summary
 SearchSource[] createSearchSources(org.w3c.dom.Element sourceElem, ISearchFieldMapFactory factory)
           
 
Methods inherited from class com.raritantechnologies.searchApp.XMLSearchSourceFactory
changeBasePath, initializeFieldFormatters, initializeSource, initializeStaticFields
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LookupSearchSourceFactory

public LookupSearchSourceFactory()
Method Detail

createSearchSources

public SearchSource[] createSearchSources(org.w3c.dom.Element sourceElem,
                                          ISearchFieldMapFactory factory)
Specified by:
createSearchSources in interface IXMLSearchSourceFactory
Specified by:
createSearchSources in class XMLSearchSourceFactory