You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Mark N <ni...@gmail.com> on 2010/07/12 10:36:36 UTC

Two analyzer per field

Is it possible to specify two analyzers per fields

for example , consider a field  *F1  *( keyword analyzer) = "cheers mate"
                                            *F2 *(keyword analyzer ) =
"hello world"

There is also a copy field  *TEXT *( standard analyzer )   which will store
the  terms  { cheers mate hello world }

now when user perform any search we will be looking at copy field "TEXT"
only which uses standard analyzer . Suppose user search "hello word"  phrase
it will not return any result
as "hello" and "world" terms are tokenized .

is it possible that I index "hello world" as it is as well in to
*TEXT*field ? i.e can I use keyword analyzer as well and standard
analyzer for
field "TEXT"
what should be better approach to handle this situation ?





-- 
Nipen Mark

Re: Two analyzer per field

Posted by Erick Erickson <er...@gmail.com>.
Could you handle this with the Dismax query handler? You could
specify that the search boost the keyword-analyzed field quite high
if you wanted those documents to come up at the top of the list....

If this doesn't help, could you elaborate on the use-case? In particular
I'm wondering why you want to use the keyword analyser in the
first place.


Best
Erick

On Mon, Jul 12, 2010 at 4:36 AM, Mark N <ni...@gmail.com> wrote:

> Is it possible to specify two analyzers per fields
>
> for example , consider a field  *F1  *( keyword analyzer) = "cheers mate"
>                                            *F2 *(keyword analyzer ) =
> "hello world"
>
> There is also a copy field  *TEXT *( standard analyzer )   which will store
> the  terms  { cheers mate hello world }
>
> now when user perform any search we will be looking at copy field "TEXT"
> only which uses standard analyzer . Suppose user search "hello word"
>  phrase
> it will not return any result
> as "hello" and "world" terms are tokenized .
>
> is it possible that I index "hello world" as it is as well in to
> *TEXT*field ? i.e can I use keyword analyzer as well and standard
> analyzer for
> field "TEXT"
> what should be better approach to handle this situation ?
>
>
>
>
>
> --
> Nipen Mark
>