Sorry Erick, my last post and your's crossed each other.

I am reluctant to use another index (or a multi-value index) since I think
it will increase the storage I need for those indexes without adding
functionality (and storage could be an issue for me).

But first let's see if I understand you correctly:

<fieldType name="fieldA">
      <analyzer type="index">
...
      </analyzer>
      <analyzer type="query">
... no synonyms
      </analyzer>
   </fieldType>    
 </types>

<fieldType name="fieldB">
      <analyzer type="index">
... (the same as "fieldA")
      </analyzer>
      <analyzer type="query">
... (the same as "fieldA" + <filter class="solr.SynonymFilterFactory"/>)
      </analyzer>
   </fieldType>    
 </types>

<field name=desc_no_synonyms type="fieldA" indexed="true" stored="true" />
<field name=desc_yes_synonyms type="fieldB" indexed="true" stored="false" />

<copyfield source="desc_no_synonyms" dest="desc_yes_synonyms"/>

User wants to query without synonyms:
1) q=desc_no_synonyms:"hot" fl=desc_no_synonyms

User wants to query with synonyms:
2) q=desc_yes_synonyms:"hot" fl=desc_no_synonyms

In case 1) the user gets the description with only "hot" in it,
in case 2) the user gets the description with "hot" or "warm" in it.

I understand that "fieldB" does not store the contents, but it will create
an extra index or expand an already existing one, right?

--
View this message in context: 
http://lucene.472066.n3.nabble.com/Multiple-search-analyzers-on-the-same-field-type-possible-tp3417898p3418874.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to