Elasticsearch case-insensitive query_string query with wildcards -
in es mapping have 'uri' field set not_analysed , i'm not allowed change mapping.i wanted search uri parts query_string query (this es query autogenerated, why bit complicated let's focus on query_string part)
{ "sort": [{"updated": {"order": "desc"}}], "query": { "bool": { "must":[{ "query_string": { "query":"*w3\\.org\\/2014\\/01\\/a*", "lowercase_expanded_terms": true, "default_field": "uri" } }], "minimum_number_should_match": 1 } }, "size": 50}
now working, i've following url stored (fictional url): http://w3.org/2014/01/abc.html , query not bring because of a-a difference. setting expanded terms false not solves this. should query case insensitive?
thanks in advance.
from docs, seems need new analyzer first transforms lowercase , can run search. have tried that? http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/sorting-collations.html
as read it, pattern, lowercase_expanded_terms, applies expansions, not regular words http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html lowercase_expanded_terms whether terms of wildcard, prefix, fuzzy, , range queries automatically lower-cased or not (since not analyzed). default true
Comments
Post a Comment