Reputation: 23084
Given a text file of unique values, is there an analyzer configuration possible that would use a field of a document that is to be indexed and look it up in the text file, and when found, add a value to another field?
Scenario: products with a unique ID are being indexed, if a product's ID is found in special.txt, then the field 'special' is set to true.
This is for adding occasional information to an index from a manually maintained external data source.
Upvotes: 1
Views: 98
Reputation: 856
You can use a transformer in your dataconfig
<dataConfig>
<script><![CDATA[
function checkProductID(row) {
if(row.get('ProducID') !== NULL)
{
row.put('special', 1);
}
return row;
}
]]></script>
<document>
<entity name="e" pk="id" transformer="checkProductID">
....
</entity>
</document>
</dataConfig>
The new field (special) must be in schema.xml
Upvotes: 0
Reputation: 52779
Nope. but you can try for options
Upvotes: 1