Thanks a lot for the combo analyzer tip. I'll give it a try soon.
Right now i found a solution to my problem by setting my_analyzer for all 
text fields. 
I'll see what the combo can do for me, but seems like a good solution.
Thx !

But i still think that would be nice to be allowed to just reference an 
analyzer in the index settings default analyzer field, like 'default': 
'my-analyser'.


Le mercredi 20 août 2014 21:05:48 UTC+2, Jörg Prante a écrit :
>
> If you want to set up a small number of known analyzers but keep the same 
> field to search on, the method ES provides is simple: use different 
> mappings within an index. 
>
> For combining analyzers for multilanguage search in a single 
> index/mapping, look at the combo analyzer: 
>
> https://github.com/yakaz/elasticsearch-analysis-combo
>
> I use this analyzer token chaining method for german/english/french words 
> in a single field with success, together with keyword repeat token filter, 
> ICU normalizer, ICU folding, and unique filter, having no need to "switch" 
> analyzers.
>
> Jörg 
>
>
>
>
> On Tue, Aug 19, 2014 at 5:24 PM, Frederic Esnault <[email protected] 
> <javascript:>> wrote:
>
>> Hi Jörg and thanks for your answer.
>>
>> I agree with, defining my custom analyzer directly would solve the 
>> problem, but i have another constraint, which makes this impossible.
>> I want to be able to select an analyzer at runtime (when creating the 
>> index), depending on the user locale.
>>
>> I had a locale adapter i made myself which converted the locale to an 
>> analyzer name, but i had problem with the french analyzer, which led me to 
>> the current problem.
>>
>> So i want to be able to :
>> 1. override the french analyzer because the built-in french analyzer does 
>> not satisfy me;
>> 2. set the default analyzer to my custom french analyzer
>> 3. for people using another language, still be able to get a default 
>> analyzer to english snowball for example.
>>
>>
>> So i'd like to be able to do something like that :
>>
>> {...{ "analyzer": "french" { "type":snowball", "language": "French" }, 
>> ..., "default" : "<program-generated-value-here>"}
>>
>> The program generated value would be a simple translation of my user's 
>> locale : fr > french, en > english, and so on...
>> The challenge here is that if "default" is set to "french", it should 
>> reference the custom "french" analyzer.
>>
>>
>>
>> Le mardi 19 août 2014 17:11:21 UTC+2, Jörg Prante a écrit :
>>
>>> This sequence
>>>
>>>  "default":{  
>>>       "type":"french"
>>>  }
>>>
>>> will not work, you do not have an analyzer of type "french".
>>>
>>> Just rename the analyzer with name "french" to the name "default" and it 
>>> will be used as default.
>>>
>>> Jörg
>>>
>>>  -- 
>> 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] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/elasticsearch/a33dec5c-b98b-4cee-a200-022d138e8ea3%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/elasticsearch/a33dec5c-b98b-4cee-a200-022d138e8ea3%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> 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/3304cac2-861e-4a63-82e6-ddd3bb620aed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to