Hi Vineeth and thanks for your answer.

If i understood correctly, what you suggest is to add a _default_ section 
in all mappings, right ?
First, I would prefer to set it once and for all in the global settings. 
I'd be surprised there is no way to reference a custom analyzer in the 
global default analyzer definition, but maybe...
Second, your link relates to default mapping, not settings.
Finally, could you give me an example of default analyzer using your 
solution, just to test ? Documentation is too thin.


Le mardi 19 août 2014 14:56:10 UTC+2, vineeth mohan a écrit :
>
> Hello Frederic , 
>
> I believe you can use the default configuration settings for this - 
>
> http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/index-modules-mapper.html#_default_mapping
>
> Thanks
>            Vineeth
>
>
>
> On Tue, Aug 19, 2014 at 5:51 PM, Frederic Esnault <[email protected] 
> <javascript:>> wrote:
>
>> Hi everyone,
>>
>> I'm trying to override the french analyser in my index. What i want is 
>> that this custom 'french' analyzer becomes the default analyzer for all 
>> searches and indexing, if none is given explicitly.
>>
>> The settings i give are like this :
>>
>> {  
>>    "index":{  
>>       "cluster.name":"test-cluster",
>>       "client.transport.sniff":true,
>>       "analysis":{  
>>          "filter":{  
>>             "french_elision":{  
>>                "type":"elision",
>>                "articles":[  
>>                   "l",
>>                   "m",
>>                   "t",
>>                   "qu",
>>                   "n",
>>                   "s",
>>                   "j",
>>                   "d",
>>                   "c",
>>                   "jusqu",
>>                   "quoiqu",
>>                   "lorsqu",
>>                   "puisqu"
>>                ]
>>             },
>>             "french_stop":{  
>>                "type":"stop",
>>                "stopwords":"_french_",
>>                "ignore_case":true
>>             },
>>             "snowball":{  
>>                "type":"snowball",
>>                "language":"french"
>>             }
>>          },
>>          "analyzer":{  
>>             "french":{  
>>                "tokenizer":"standard",
>>                "filter":[  
>>                   "french_elision",
>>                   "lowercase",
>>                   "french_stop",
>>                   "snowball"
>>                ]
>>             },
>>             "lower_analyzer":{  
>>                "type":"custom",
>>                "tokenizer":"keyword",
>>                "filter":"lowercase"
>>             },
>>             "token_analyzer":{  
>>                "type":"custom",
>>                "tokenizer":"whitespace"
>>             },
>>             "default":{  
>>                "type":"french"
>>             }
>>          }
>>       }
>>    }
>> }
>> The problem is that my analyzer seems to work correctly, but it is not 
>> used as a default.
>> A test with inquisitor plugin gives me this :
>>
>> Index: test-index Analyzed Text default aime 1cheval 3 french aim 1
>> cheval 3 lower_analyzer j'aime les chevaux 1 token_analyzer j'aime 1les 2
>> chevaux 3 
>> As you can see, the french override analyzer gives me a perfect result, 
>> but the default one gives me wrong result. The verb is not stemmed to 'aim' 
>> and stays 'time' (which is not correct). Only the 'chevaux' word is stemmed 
>> to 'cheval' (which is correct).
>>
>> Do you know what i'm doing wrong ? Or how i could do to tell 
>> ElasticSearch to choose my custom french analyzer as its default analyzer 
>> instead of digging out the built-in french analyzer ?
>>
>> Note : I tried giving it directly a name instead of a type, but with no 
>> luck, like this  :    "default": "french"
>>
>> Thanks for all your help in advance !
>>
>>  -- 
>> 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/980c2240-15ec-4ba2-ad46-a57e17300070%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/elasticsearch/980c2240-15ec-4ba2-ad46-a57e17300070%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/1b619d79-8bc7-4832-8835-7854837d6421%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to