lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntsrikanth <>
Subject Facet mappings
Date Wed, 28 Sep 2011 20:38:43 GMT

  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"/>

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

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

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:
Sent from the Solr - User mailing list archive at

View raw message