com.raritantechnologies.searchApp.resultComparators
Class TermSentenceMatcher

java.lang.Object
  extended bycom.raritantechnologies.searchApp.resultComparators.TermSentenceMatcher
All Implemented Interfaces:
IConfigurable, IQueryResultMatcher

public class TermSentenceMatcher
extends java.lang.Object
implements IQueryResultMatcher

Matches an IResult if query terms are within the same sentence in the result fields.

XML Configuration Template:
   <ResultMatcher class="com.raritantechnologies.searchApp.resultComparators.TermSentenceMatcher"
                        queryFields="[ comma separated list of query fields to get search terms ]"
                        allFieldsMatch="[true|false(default)]"
                        minLength="[ minimum sentence length ]" >

     <!-- Fields to get values to compare in result -->
     <ResultFields>
       <!-- One or more Field elements  -->
       <Field ID="[ field ID ]" />
       <Field ID="[ another field ]" >
         <StringFilter class="[ class of com.raritantechnologies.utils.filter.IStringFilter ]" >

         </StringFilter>
       </Field>
     </ResultFields>
   
   </ResultMatcher>
 

Developed by Raritan Technologies .

Author:
Ted Sullivan

Constructor Summary
TermSentenceMatcher()
           
 
Method Summary
 void addFieldFilter(java.lang.String fieldName, IStringFilter filter)
           
 boolean equals(ILoginInfo user, OrderedMap queryParams, IResult result)
           
 java.lang.String getConfigurationXML()
           
 java.lang.String getConfigurationXML(java.lang.String configurationTemplate)
           
 void initialize(org.w3c.dom.Element elem)
          Initializes the object from an XML tag or element.
 void setMinimumLength(int minLength)
           
 void setQueryFields(java.lang.String[] queryFields)
           
 void setResultFields(java.lang.String[] resultFields)
           
 void setTerms(java.lang.String[] terms)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TermSentenceMatcher

public TermSentenceMatcher()
Method Detail

setMinimumLength

public void setMinimumLength(int minLength)

setQueryFields

public void setQueryFields(java.lang.String[] queryFields)

setResultFields

public void setResultFields(java.lang.String[] resultFields)

setTerms

public void setTerms(java.lang.String[] terms)

addFieldFilter

public void addFieldFilter(java.lang.String fieldName,
                           IStringFilter filter)

equals

public boolean equals(ILoginInfo user,
                      OrderedMap queryParams,
                      IResult result)
Specified by:
equals in interface IQueryResultMatcher

initialize

public void initialize(org.w3c.dom.Element elem)
Description copied from interface: IConfigurable
Initializes the object from an XML tag or element. This method is called by the Framework as part of the application initializtion. see ConfigurationManager, XMLConfigurationManager, XMLSearchFieldMapFactory, XMLSearchSourceFactory. Configurable objects that are owned or contained by other configurable objects will be initialized in by the parent object.

Specified by:
initialize in interface IConfigurable

getConfigurationXML

public java.lang.String getConfigurationXML()

getConfigurationXML

public java.lang.String getConfigurationXML(java.lang.String configurationTemplate)