com.raritantechnologies.concept.clustering
Class FacetedResultSetProcessor

java.lang.Object
  extended bycom.raritantechnologies.concept.clustering.FacetedResultSetProcessor
All Implemented Interfaces:
IConfigurable, IGatewayOutputProcessor, IResultSetProcessor

public class FacetedResultSetProcessor
extends java.lang.Object
implements IResultSetProcessor, IGatewayOutputProcessor

Generates a two-dimensional Facet map from a set of IResult objects. The map contains a list of facets (mapped to result fields) and each facet is associated with a map of facet value to result ID list. The processor generates an output XML that can be written to an IXMLPersist object.

XML Configuration Template:
    <ResultSetProcessor class="com.raritantechnologies.concept.clustering.FacetedResultSetProcessor"
                           resultFacetFields="[ comma separated list of result fields to create the facets from ]"
                           rootTagName="[ name of the root XML tag: default='Facets' ]"
                           facetTagName="[ name of facet tag: default='Facet' ]"
                           valueTagName="[ name of the value tag: default='Value' ]"
                           valueTextTagName="[ name of the value text tag: default='Text' ]"
                           countTagName="[ name of count field in output result: default='Count' ]" >

      <!-- Object that can save the generated XML -->
      <XMLPersist class="[ class of com.raritantechnologies.xml.dataCollection.IXMLPersist ]" >

      </XMLPersist>

      <OutputFields>
         <Field ID="[ result field ID ]" resultTag="[ tagname in result XML ]" />
      </OutputFields>

      <!-- Optional OutputProcessor that can process the Facet Results -->
      <OutputProcessor class="[ class of com.raritantechnologies.searchApp.dataCollection.IGatewayOutputProcessor"
                          nestedResultsField="[ field that gets the results that cluster on a particular facet value ]" >

      </OuputProcessor>

    </ResultSetProcessor>
  
Output XML Format:
  <Facets>
    <!-- One or more Facet tags: -->
    <Facet name="[ name of facet field ]" >
      <!-- One or more Value tags: -->
      <Value>
        <Text>[ value of facet ]</Text>

        <!-- One or more Result tags that contain this value -->
        <Result>[Output fields of Result]</Result>
        <Result>[etc...]</Result>
      </Value>

      <Value>
        <!-- etc... -->
      </Value>
    </Facet>

    <Facet name="[ name of the facet field ]" >
      <!-- etc... -->
    </Facet>
  </Facets>

 
Developed by Raritan Technologies .

Author:
Ted Sullivan

Constructor Summary
FacetedResultSetProcessor()
           
 
Method Summary
 INavigator createNavigator(IResultSet resSet)
           
 void dataComplete()
          Data feed is complete.
 java.lang.String getConfigurationXML()
           
 java.util.Map getFacetMap()
          Returns the Computed Facet map: Facet field --> facet value map.
 IResultSet getFacetMapResultSet()
           
 java.lang.String getFacetMapXML()
           
 void initialize(org.w3c.dom.Element elem)
          Initialize the from XML Element.
 void initialize(org.w3c.dom.Element elem, ISearchFieldMap sfMap)
          Initialize the GatewayOutputProcessor from XML Configuration Element.
 void initialize(java.util.Map initMap)
          Dynamic initialization.
 java.lang.String processData(IResultSet resSet)
          returns name of XML File created/appended.
 void processResultSet(java.lang.String sessionID, IResultSet resSet)
          processes the IResultSet (somehow)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FacetedResultSetProcessor

public FacetedResultSetProcessor()
Method Detail

createNavigator

public INavigator createNavigator(IResultSet resSet)

getFacetMap

public java.util.Map getFacetMap()
Returns the Computed Facet map: Facet field --> facet value map.


getFacetMapXML

public java.lang.String getFacetMapXML()

processData

public java.lang.String processData(IResultSet resSet)
Description copied from interface: IGatewayOutputProcessor
returns name of XML File created/appended.

Specified by:
processData in interface IGatewayOutputProcessor

processResultSet

public void processResultSet(java.lang.String sessionID,
                             IResultSet resSet)
Description copied from interface: IResultSetProcessor
processes the IResultSet (somehow)

Specified by:
processResultSet in interface IResultSetProcessor

dataComplete

public void dataComplete()
Description copied from interface: IResultSetProcessor
Data feed is complete.

Specified by:
dataComplete in interface IResultSetProcessor

getFacetMapResultSet

public IResultSet getFacetMapResultSet()

initialize

public void initialize(org.w3c.dom.Element elem)
Description copied from interface: IResultSetProcessor
Initialize the from XML Element.

Specified by:
initialize in interface IResultSetProcessor

initialize

public void initialize(org.w3c.dom.Element elem,
                       ISearchFieldMap sfMap)
Description copied from interface: IGatewayOutputProcessor
Initialize the GatewayOutputProcessor from XML Configuration Element.

Specified by:
initialize in interface IGatewayOutputProcessor

initialize

public void initialize(java.util.Map initMap)
Description copied from interface: IResultSetProcessor
Dynamic initialization.

Specified by:
initialize in interface IResultSetProcessor

getConfigurationXML

public java.lang.String getConfigurationXML()
Specified by:
getConfigurationXML in interface IGatewayOutputProcessor