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" <s6nu...@gmail.com> 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 elasticsearch+unsubscr...@googlegroups.com.
> 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/CALY%3DcQDpvwRMPmLTX2ung%2BS6o8nz0k2mMtgmvZwEQMSCygRAPw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to