(11/09/29 5:38), ntsrikanth wrote:
Hi,
I got a set of values which needs to be mapped to a facet. For example, I
want to map the codes
SC, AC to the facet value 'Catering',
HB to Half Board
AI, IN to All\ inclusive
I tried creating the following in the schema file.
<fieldType name="alpine_field_boardbasis" class="solr.TextField"
sortMissingLast="true" omitNorms="true">
<analyzer type="index">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.SynonymFilterFactory" synonyms="boardbasis_synonyms.txt"
ignoreCase="true" expand="false"/>
</analyzer>
</fieldType>
Use KeywordTokenizerFactory instead of StandardTokenizerFactory. The factory
class
should also be specified in <filter/> for synonym like:
<filter class="solr.SynonymFilterFactory"
tokenizerFactory="solr.KeywordTokenizerFactory" .../>
as it uses WhitespaceTokenizerFactory to analyze synonyms.txt if tokenizer
factory is
not specified.
koji
--
Check out "Query Log Visualizer" for Apache Solr
http://www.rondhuit-demo.com/loganalyzer/loganalyzer.html
http://www.rondhuit.com/en/