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>

<copyField source="board_basis" dest="Board Basis" />
<field multiValued="false" name="Board Basis" type="field_boardbasis"
stored="false"/>



And in boardbasis_synonyms.txt

SC => Self\ Catering
CA => Catered\ Chalet
HB => Half\ Board
FB => Full\ Board
RO => Room\ only\ no\ kitchen\ facilities
EM => Self\ catering\ with\ evening\ meal
BB => Bed\ &\ Breakfast
AI, IN => All\ inclusive


But when I do a query
(http://localhost:8888/solr/collection1/select/?q=brochure_year%3A12&version=2.2&start=0&rows=1&indent=on&facet=true&facet.field=Board%20Basis),
 

I get the following
<lst name="Board Basis">
<int name="catering">455</int>
<int name="self">455</int>
<int name="board">281</int>
<int name="half">243</int>
<int name="catered">114</int>
<int name="chalet">114</int>
<int name="&">63</int>
<int name="bed">63</int>
<int name="breakfast">63</int>
<int name="evening">45</int>
<int name="meal">45</int>
<int name="with">45</int>
<int name="full">38</int>
<int name="all">27</int>
<int name="inclusive">27</int>
<int name="facilities">9</int>
<int name="kitchen">9</int>
<int name="no">9</int>
<int name="only">9</int>
<int name="room">9</int>


I am expecting to see  something like
<lst name="Board Basis">
<int name="Catered Chalet">455</int>
<int name="Self Catering">455</int>
<int name="Half Board">281</int>




Thanks in advance,

Srikanth NT



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Facet-mappings-tp3377317p3377317.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to