Hey,

the filter you applied returns all documents which contain "C" in the brand
field. This is the expected behaviour. Elasticsearch does not modify the
original document before it is being returned, so it also contains the
other values. The term filter is just about inclusion/exclusion of your
documents beign returned for that alias.

Hope it makes sense.


--Alex


On Thu, Mar 20, 2014 at 2:06 PM, Anurag Tripathi <[email protected]>wrote:

> Hi, I have a document indexed in this format.
>
> "hits": [
>          {
>             "_index": "temp",
>             "_type": "test",
>             "_source": {
>                "brand": [
>                   "A",
>                   "B",
>                   "C",
>                   "D",
>                   "E",
>                   "F",
>                   "G"
>                ],
>                "search_term": "",
>                "age": "19-35 Years",
>                "dob": "1981-06-01T00:00:00.000Z",
>                "deal": [
>                   "P",
>                   "Q",
>                   "R",
>                   "S",
>                ]
>             }
>          }
>
> I want to extract information related to "brand" : "C".I applied a term
> filter on the created alias but It's not giving me the particular
> value,however it gives me all the values (brand :
> "A","B","C","D","E","F","G".Any trick to get "C" and all the values related
> to "C" ? Here is the term filter which I am applying.Not sure,If I have to
> apply a custom CSV analyzer ?
>
> POST /_aliases
> {
>     "actions" : [
>         {
>             "add" : {
>                  "index" : "temp",
>                  "alias" : "temp_alias",
>                 "filter" : {
>                       "or" : [
>                 {
>                     "term" : { "brand" : "C" }
>                 }
>             ]
>                  }
>             }
>         }
>     ]
> }
>
>
> brand and deal are having this mapping.
>
> "brand": { "type": "string", "index": "not_analyzed" }
>
>
> Thanks,
>
> Anurag
>
>  --
> 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/f62d1ac3-0614-4034-a664-eab868cb1fd7%40googlegroups.com<https://groups.google.com/d/msgid/elasticsearch/f62d1ac3-0614-4034-a664-eab868cb1fd7%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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/CAGCwEM_2hx_1uHQRcAXFZT-Y_%3DadrHc%2BtfE8fQD%2BwmUO-V4umA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to