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]> 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-indexAnalyzed Textdefaultaime 1cheval 3frenchaim 1cheval 3
> lower_analyzerj'aime les chevaux 1token_analyzerj'aime 1les 2chevaux 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].
> 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/CAGdPd5%3D86V%2BJ9ynikWMSj1NK0WU67GaT_o9T76BsVGVHtU1_%2Bg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to