Hi all,
I have the following mapping where text has the spanish analyzer:
$ curl -XGET 'localhost:9200/haystack/_mapping?pretty=true'
{
"haystack" : {
"modelresult" : {
"properties" : {
"content_auto" : {
"type" : "string",
"analyzer" : "edgengram_analyzer",
"store" : "yes",
"term_vector" : "with_positions_offsets"
},
"django_ct" : {
"type" : "string"
},
"django_id" : {
"type" : "string"
},
"id" : {
"type" : "string"
},
"pub_date" : {
"type" : "date",
"index" : "analyzed",
"store" : "yes",
"format" : "dateOptionalTime"
},
-
"text" : {*
-
"type" : "string",*
-
"analyzer" : "spanish",*
-
"store" : "yes",*
-
"term_vector" : "with_positions_offsets"*
-
}},* "title" : { "type" : "string", "boost" : 1.5, "analyzer" : "spanish", "store" : "yes", "term_vector" : "with_positions_offsets" } }
}
}
But it seems to be ignored ("esto" is a stopword in the spanish analyzer):
$ curl -XGET
'localhost:9200/haystack/_analyze?text=esto+is+a+test&pretty=true&explain=true'
{
"tokens" : [ {
"token" : "esto",
"start_offset" : 0,
"end_offset" : 4,
"type" : "",
"position" : 1
}, {
"token" : "test",
"start_offset" : 10,
"end_offset" : 14,
"type" : "",
"position" : 4
} ]
But if I specify the analyzer directly then it works:
$ curl -XGET
'localhost:9200/haystack/_analyze?text=esto+is+a+test&pretty=true&explain=true&analyzer=spanish'
{
"tokens" : [ {
"token" : "is",
"start_offset" : 5,
"end_offset" : 7,
"type" : "",
"position" : 2
}, {
"token" : "test",
"start_offset" : 10,
"end_offset" : 14,
"type" : "",
"position" : 4
} ]
Any idea what am I doing wrong? If I specify my own analyzers in the
settings it doesn't work either.
Many thanks.
--