Tried to remove papping and make not_analizable curl -XPUT "http://$HOST:9200/reports" -d' { "mappings": { "_default_": { "dynamic_templates": [ { "store_generic" : { "match" : "*", "match_mapping_type" : "string", "mapping" : { "type" : "string", "index" : "not_analyzed" } }
} ] } } }' But Easy filtering returns empty results for "approved", "not approved" or "". Search example curl -X GET 'http://localhost:9200/reports/_search?pretty' -d '{ "filter":{ "term":{ "general.approval": "approved" } } } ' Should I do other filtering syntax for this case? On Tuesday, October 7, 2014 5:17:02 PM UTC+3, Ivan Brusic wrote: > > The field do not need a custom analyzer, they just need to be simply > marked as non_analyzed. > > You can setup a dynamic template that states any new field should be non > analyzed. > > > http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-root-object-type.html#_dynamic_templates > > You can still hardcode the mapping for specific fields. > > Cheers, > > Ivan > On Oct 7, 2014 2:57 AM, "Vladimir Krylov" <s6n...@gmail.com <javascript:>> > wrote: > >> What I'm trying to do is to get data by filtering term with exact >> matching. I have ES 1.3.2 and I cannot do mapping, as attributes are >> dynamic (different users has different attributes). My data: >> >> { id: 111, >> org_id: 11, >> approval: "approved", >> ... >> } >> >> >> >> >> { id: 112, >> org_id: 11, >> approval: "not approved", >> ... >> } >> >> >> This request returns results: >> >> curl -X GET 'host:9200/data/_search?pretty' -d '{ >> "filter":{ >> "term":{ >> "approval":"approved" >> } >> } >> } >> >> >> >> But this not: >> >> curl -X GET 'host:9200/reports/_search?pretty' -d '{ >> "filter":{ >> "term":{ >> "approval":"not approved" >> } >> } >> } >> >> >> >> It's a dup of ticket >> https://github.com/elasticsearch/elasticsearch/issues/8006#issuecomment-58160111 >> >> As I was followed here. >> >> David Pilato proposed that "index has indexed probably not and approved" >> and that there is no exact matching to "not approved". I tried to search >> for word "not" and it works >> >> curl -X GET 'host:9200/reports/_search?pretty' -d '{ >> "filter":{ >> "term":{ >> "approval":"not" >> } >> } >> } >> >> So, how can I filter by exact word matching "not approved"? >> >> -- >> 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 elasticsearc...@googlegroups.com <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/elasticsearch/6ea46153-68a7-481f-9064-9e094094bf29%40googlegroups.com >> >> <https://groups.google.com/d/msgid/elasticsearch/6ea46153-68a7-481f-9064-9e094094bf29%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/4cc3fe20-296c-4a63-af9c-ec1516e3f54e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.