There's nothing in Solr that'll do this for you that I
know of. The copyfield solution is probably your
best option.

The idea is that you have two field definitions
that use two different field types, one for each
flavor or query analyzer. Then, you can use
<copyField> to copy the field in question into
the second field. Now you use different
forms of the query, something like
q=field1:stuff
or
q=field2:stuff
when you want to make the distinction.

Best
Erick

On Thu, Oct 13, 2011 at 2:38 AM, Victor <scanner...@yahoo.co.uk> wrote:
> I would like to do the following in solr/lucene:
>
> For a demo I would like to index a certain field once, but be able to query
> it in 2 different ways. The first way is to query the field using a synonym
> list and the second way is to query the same field without using a synonym
> list. The reason I want to do this is that I want the synonym list to be
> flexible and do not want to re-index everything when the list changes. Also,
> I want to be able to let the user decide if he/she wants to use the synonym
> list while querying.
>
> I had hoped that a solution like this would be possible:
>
> <fieldType name="blabla">
>      <analyzer type="index">
> ...
>      </analyzer>
>      <analyzer type="query1">
> ...
>      </analyzer>
>      <analyzer type="query2">
> ...
>      </analyzer>
>    </fieldType>
>
> And then use some kind of parameter in the url to select either query1 or
> query2, but this does not seem possible in solr/lucene.
>
> Maybe I can use a solution using the <copyfield> command, but so far I have
> not been successful in getting this to work.
>
> I still hope this is possible, thanks in advance for your help on this.
>
>
> --
> View this message in context: 
> http://lucene.472066.n3.nabble.com/Multiple-search-analyzers-on-the-same-field-type-possible-tp3417898p3417898.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Reply via email to