I storing documents as shown below:
"keywords": [
                  {
                     "name": "#nfl",
                     "type": "general hashtag word",
                     "postag": "nnp"
                  },
                  {
                     "name": "#bill",
                     "type": "general hashtag word",
                     "postag": "nnp"
                  },
                  {
                     "name": "video",
                     "type": "general word noun "keywords" is nested 
fieldchunk",
                     "postag": "noun"
                  }
]
*"keywords" is nested field*
Now how can I query so that the document returned  should only have those 
objects from the "keywords" field which has "type" as "general hashtag word"

I am trying the following query . However with this query all the objects 
are returned if any one of the object in the keywords field have type as 
"general hashtag word"
{
  "size":20,
 
   "query" : {
      "filtered" : {
         "filter" : {
        "nested" : {
            "path" : "keywords",
            "filter" : {
              
               "term" : {"type" : "general hashtag word" }
            }
       
                
            }
        }
      }
   }
}

-- 
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/cc947f27-8df8-4973-a254-0ddb9163358b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to