Hello group,
Here's what I am trying to achieve:
For testing purposes I created a default template which is inserted using
the _template
endpoint into elastic search. The template should be applied to all indexes
starting with the string "docs" (for brevity I omitted some of the other
fields)
{
"template": "docs*",
"settings": {
"query.default_field": "@message",
"action.auto_create_index": "+docs*",
"number_of_shards": 1,
"number_of_replicas": 1,
"routing.allocation.total_shards_per_node": 1,
"auto_expand_replicas": false,
"index": {
"analysis": {
"analyzer": {
"my_doc_analyser": {
"type": "custom",
"tokenizer": "whitespace",
"filter": ["standard", "lowercase"]
}
}
}
}
},
"mappings": {
"default": {
"_all": {
"enabled": true
},
"_source": {
"compress": false
},
"properties": {
"@time": {
"type": "date",
"index": "not_analyzed"
},
"@message": {
"type": "string",
"index": "analyzed",
"analyzer": "my_doc_analyser"
}
}
}
}
}
Now, I insert a document into my elasticsearch instance, for instance
having the
text: (index is automatically created)
"Hello, how are you doing Donny"
I then issue a query_string search to this endpoint:
http://127.0.0.1:9200/docs-testicus/_search
... using this query in the body:
{
"query": {
"query_string": {
"query": "Donny"
}
}
}
.. I then get the (1) result.
Now, I EXPECTED to also be able to issue searches with lowercased inputs,
such as:
{
"query": {
"query_string": {
"query": "donny"
}
}
}
However, this gives me 0 hits.
Can anyone explain WHY I cannot do lower-case searches when a lowercase
filter is part
of the analyzer?
When I tried testing my custom analyzer using the _analyze endpoint, I can
see
that the input tokens are indeed turned into lowercase.
Cheers,
- Chris
--
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.