You don't need to index fields several times, you can index is just into
one field, and use the different query analyzers just to build the query.
We're doing this for authors, for example - if query language says
"=author:einstein", the query parser knows this field should be analyzed
differently (that is the part of your application logic, of your query
language semantics - so it can vary).

The parser will change the 'author' to 'nosynonym_author', this means
'nosynonym_author' analyzer to be used for analysis phase, and after the
query has been prepared, we 'simply' change the query field from
'nosynonym_author' into 'author'. Seems complex, but it is actually easy.
But it depends on what a query parser you can/want to use. I use this:
https://issues.apache.org/jira/browse/LUCENE-5014

roman




On Tue, Sep 3, 2013 at 11:41 AM, Daniel Rosher <rosh...@gmail.com> wrote:

> Hi,
>
> We have a need to specify a different query analyzer depending on input
> parameters dynamically.
>
> We need this so that we can use different stopword lists at query time.
>
> Would any one know how I might be able to achieve this in solr?
>
> I'm aware of the solution to specify different field types, each with a
> different query analyzer, but I'd like not to have to index the field
> multiple times.
>
> Many thanks
> Dab
>

Reply via email to