Hi,
I'm trying to make a prefix query on a field that can hold non-ascii
spanish characters (i.e áéíóúñ)
I've made a custom analyzer and have added it to a field in my mapping by
doing:
create index
curl -XPUT 'elasticsearch:9200/my_new_index' -d '{
"settings": {
"index": {
"analysis": {
"analyzer": {
"my_custom_analyzer": {
"type": "custom",
"tokenizer": "keyword",
"filter": ["asciifolding", "lowercase"]
}
}
}
}
}
}'
create mapping
curl -XPUT 'elasticsearch:9200/my_new_index/my_mapping/_mapping' -d '{
"properties": {
"guid": {"type": "string", "index": "no"},
"name": {
"type": "string",
"index": "analyzed",
"analyzer": "my_custom_analyzer"
}
}
}'
I can confirm the analyzer is working fine since I've tried it directly
via the Analyzer API by running:
curl -XGET
'elasticsearch:9200/my_new_index/_analyze?analyzer=my_custom_analyzer' -d
'áéíóú'
{
"tokens" : [ {
"token" : "aeiou",
"start_offset" : 0,
"end_offset" : 5,
"type" : "word",
"position" : 1
} ]
}
But for some reason, the queries on the mapping are not using the analyzer,
namely the following query. If I understand correctly it should match
documents starting with both "aei" and "áéí", but it only matches the
latter case.
curl -XPOST 'elasticsearch:9200/my_new_index/my_mapping/_search?pretty=true' -d '{
"query": {
"prefix": {
"name" : {
"prefix": "áéí"
}
}
}
}'
What I'm I missing? A full, runnable, example showing the problem can be
found here: https://gist.github.com/ivoscc/6518829
Thanks a lot for your help!
Ivo
--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.