Right. Let me elaborate my question, then.
This is my analyzer at first:
test:
type: custom
tokenizer: standard
filter: [standard]
$ curl -XPUT 'http://localhost:1980/t';echo
{"ok":true,"acknowledged":true}
$ curl -XPUT 'http://localhost:1980/t/t/_mapping' -d'{"t": {"properties":
{"title": {"type":"string", "analyzer": "test"}}}}';echo
{"ok":true,"acknowledged":true}
$ curl -XPOST 'http://localhost:1980/t/t/1' -d'{"title": "ATLETICO"}';echo
{"ok":true,"_index":"t","_type":"t","_id":"1","_version":1}
$ curl -XPOST 'http://localhost:1980/t/_search?pretty' -d'{"query":
{"query_string": {"fields": ["title"], "query": "ATLETICO",
"analyzer":"test"}}}';echo
{
"took" : 44,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"failed" : 0
},
"hits" : {
"total" : 1,
"max_score" : 0.30685282,
"hits" : [ {
"_index" : "t",
"_type" : "t",
"_id" : "1",
"_score" : 0.30685282, "_source" : {"title": "ATLETICO"}
} ]
}
}
$ curl -XPOST 'http://localhost:1980/t/_search?pretty' -d'{"query":
{"query_string": {"fields": ["title"], "query": "atletico",
"analyzer":"test"}}}';echo
{
"took" : 2,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"failed" : 0
},
"hits" : {
"total" : 0,
"max_score" : null,
"hits" : [ ]
}
}
So far so good. Now I changed my analyzer to this (and restarted
elasticsearch):
test:
type: custom
tokenizer: standard
filter: [lowercase, standard]
Now that last query returns a result:
$ curl -XPOST 'http://localhost:1980/t/_search?pretty' -d'{"query":
{"query_string": {"fields": ["title"], "query": "atletico",
"analyzer":"test"}}}';echo
{
"took" : 45,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"failed" : 0
},
"hits" : {
"total" : 1,
"max_score" : 0.30685282,
"hits" : [ {
"_index" : "t",
"_type" : "t",
"_id" : "1",
"_score" : 0.30685282, "_source" : {"title": "ATLETICO"}
} ]
}
}
What's happening?
--
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/CAKCnWVn%3DhD30h8nEzw4fWxbqGcqD%3DAX%2BiJhg%3D%3D%2BSroXb%2BzRcag%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.