I don't think you can do that.

Because index analyzer is applied to each doc and could be different.
Search analyzer is applied to your query before searching in the inverted index.

What you should do is to run a bool should query using all analyzers you know 
if you can not detect your user language (or analyzer he'd like).

My 2 cents

--
David ;-)
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs


Le 9 avr. 2014 à 04:54, Ivan Ji <[email protected]> a écrit :

Hi all,

Assume my index mapping is 

> "mappings": {
>     "main": {
>     "_source": {"enabled": true},
>     "_analyzer":{"path": "analyzer_name"},
>     "properties": {
>                         "name": { "type": "string", "index": "analyzed"},
>                         "analyzer_name": { "type": "string", "index": "no", 
> "include_in_all": false}
>                         }
>                   }
> }

By setting the "_analyzer", we know the default index analyzer id decided by 
the value of the "analyzer_name" field. Therefore, the analyzer of "name" field 
is decided by the "analyzer_name" field of the same document.

But how about the search analyzer? 

Under my test, it seems the search analyzer is not same with the index analyzer 
which is the value of "analyzer_name" field.
The search analyzer seems always be standard. It seems it just statically find 
the search analyzer in the mapping  and it just cannot find any setting, so it 
just use the standard default analyzer ?
That's my guess. Is that correct?

But are there any ways to let the search analyzer be the same one of the index 
analyzer that is decided by the "analyzer_name" field of the same document ?

Ideas?

cheers,

Ivan
-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/2fdb749e-745b-40b5-965f-f6b82a1e4f7f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/E9B269EA-A65D-4153-9F3F-82FECAD29574%40pilato.fr.
For more options, visit https://groups.google.com/d/optout.

Reply via email to