| Main | Javadoc | Example |
|
|
The LookupSearchSource is used to provide a query and/or result metadata expansion capability by enabling a multi-stage search that can combine any RTI SearchSource. This example will be used to enhance the TreeSearchSource demo. In that example, the initial search can find the name and path of nodes in the Framework Documentation tree (seen to the left). We would like to add to this links to the Example page and Javadoc page. These are commonly named nodes so that a direct search on these names would yield many irrelevant results.
We will use the LookupSearchSource to find the Javadoc node attached to the class's main node by appending "/Javadoc" to the path field of the initial result (using a ConcatenateFilter ) and re-executing the search, repeating the operation with another LookupSearchSource will give us the "Example" link.
To use the demo, type in the name of an RTI Framework class (e.g. 'LookupSearchSource' ).
<!-- ========================================================================= -->
<!-- Tree Search Source -->
<!-- ========================================================================= -->
<SourceType name="FrameworkTreeSource" type="TreeSearchSource"
sourceFactoryClass="com.raritantechnologies.utils.tree.TreeSearchSource"
queryProcessor="com.raritantechnologies.utils.tree.TreeSearchSource" >
<TreeBuilder class="com.raritantechnologies.utils.tree.SAXTreeBuilder"
fileName="BASE_PATH/WEB-INF/conf/RaritanFrameworkTree.xml"
treeName="Framework Modules" >
<TreeNode nodeTag="ConfigurableType"
nameAttribute="name" >
</TreeNode>
<TreeNode nodeTag="Link"
nameAttribute="type" >
<AttributeMap input="href" output="href" />
<AttributeMap input="description" output="description" />
</TreeNode>
</TreeBuilder>
</SourceType>
<!-- ========================================================================= -->
<!-- Performs a Lookup on the result path for the Example Link -->
<!-- -->
<!-- Settings: -->
<!-- addAllRequestParams="false" - forces lookup to use just the path param -->
<!-- addAllInputResults="true" - output results comes from input source -->
<!-- excludeOutputHits="true" - " " " " " " -->
<!-- nestedResultField="ExampleLink" - add example link as nested result -->
<!-- ========================================================================= -->
<SourceType name="ExampleTreeSource" type="LookupSearchSource"
displayName="TreeSource Plus Javadoc"
sourceFactoryClass="com.raritantechnologies.searchApp.sourceMap.LookupSearchSourceFactory"
queryProcessor="com.raritantechnologies.searchApp.sourceMap.LookupQueryProcessor"
addAllRequestParams="false"
nestedResultField="ExampleLink"
addAllInputResults="true"
excludeOutputHits="true" >
<Fields>
<AddToQuery ID="path" >
<StringFilter class="com.raritantechnologies.utils.filter.ConcatenateFilter"
prependString="" appendString="/Example" />
</AddToQuery>
<AddToOutput ID="name" />
<AddToOutput ID="path" />
</Fields>
<InputSource>FrameworkTreeSource</InputSource>
<OutputSource>FrameworkTreeSource</OutputSource>
</SourceType>
<!-- ========================================================================= -->
<!-- Performs a Lookup on the result path for the Javadoc Link (as above) -->
<!-- ========================================================================= -->
<SourceType name="JavadocTreeSource" type="LookupSearchSource"
displayName="TreeSource Plus Javadoc"
sourceFactoryClass="com.raritantechnologies.searchApp.sourceMap.LookupSearchSourceFactory"
queryProcessor="com.raritantechnologies.searchApp.sourceMap.LookupQueryProcessor"
addAllRequestParams="false"
nestedResultField="JavadocLink"
addAllInputResults="true"
excludeOutputHits="true" >
<Fields>
<AddToQuery ID="path" >
<StringFilter class="com.raritantechnologies.utils.filter.ConcatenateFilter"
prependString="" appendString="/Javadoc" />
</AddToQuery>
<AddToOutput ID="name" />
<AddToOutput ID="path" />
</Fields>
<InputSource>ExampleTreeSource</InputSource>
<OutputSource>FrameworkTreeSource</OutputSource>
</SourceType>