com.raritantechnologies.searchApp.resultComparators
Class ResultFieldMatcher
java.lang.Object
com.raritantechnologies.searchApp.resultComparators.ResultFieldMatcher
- All Implemented Interfaces:
- IConfigurable, IResultMatcher
- public class ResultFieldMatcher
- extends java.lang.Object
- implements IResultMatcher
Matches against one or more result fields using given match values. Supports case sensitive or case insensitive matching.
Can use a configurable IComparator to perform the field match.
XML Configuration Template:
<ResultMatcher class="com.raritantechnologies.searchApp.resultComparators.ResultFieldMatcher"
isAnd="true"
caseSensitive="false" >
<Fields>
<Field ID="[the field ID]" matchValue="field Value match" />
<Field ID="[the field ID 2]" matchValue="field Value to match field 2" />
<!-- Can use a nested IComparator to check for a value match -->
<Field ID="[the field ID 3]" >
<Comparator class="[ class of com.raritantechnologies.utils.comparators.IComparator]" >
<!-- configuration parameters for IComparator -->
</Comparator>
</Field>
<!-- Alternatively, the matchValue can come from another result field -->
<Field ID="the field ID" matchField="[ result field to get the match value from ]" >
</Field>
<!-- The match Value can be expanded prior to comparison using a lookup search source: -->
<Field ID="the field ID" matchField="[ result field to get the match value(s) from ]"
matchMode="[ANY|ALL - match any (OR) or all (AND) matchField values ]" >
<KeywordLookupSource
searchSource="[ alternative: Lookup source to find related keywords ]"
searchField="[ field in lookup source to get search keyword ]"
resultField="[ field in lookup results to get related keywords ]" />
</Field>
</Fields>
</ResultMatcher>
Developed by
Raritan Technologies .
- Author:
- Ted Sullivan
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ResultFieldMatcher
public ResultFieldMatcher()
ResultFieldMatcher
public ResultFieldMatcher(java.lang.String fieldID,
IComparator fieldComp)
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
equals
public boolean equals(ILoginInfo user,
IResult result)
- Specified by:
equals in interface IResultMatcher
addMatchField
public void addMatchField(java.lang.String matchField,
java.lang.String matchValue)
addMatchField
public void addMatchField(java.lang.String matchField,
IComparator matchComparator)
getConfigurationXML
public java.lang.String getConfigurationXML()
- Specified by:
getConfigurationXML in interface IResultMatcher
getConfigurationXML
public java.lang.String getConfigurationXML(java.lang.String configurationTemplate)
- Specified by:
getConfigurationXML in interface IResultMatcher