Yes, it will make your existing index larger, but it's, as far as I know,
the only way to effect this. You've outlined the process well.
But this may not be that valuable in the general case. Very frequently,
if people use different analyzers at index and query time, the get into
deep trouble. And in this specific instance, I'm assuming that you're
NOT expanding synonyms at index time, which has its own
problems (see multi-word synonym expansion).

So, one way to handle this is only do index-time expansion, but
boost the term at query time very high. That way, the exact term
will tend to be more valuable for score calculations.

It's not a straightforward problem, perhaps this an XY problem. So
if you could back up a bit and explain what problem you're trying
to solve from a higher-level perhaps other methods would be more
appropriate...

Best
Erick

On Thu, Oct 13, 2011 at 11:11 AM, Victor <scanner...@yahoo.co.uk> wrote:
> 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