ElasticSearch group by aggregation query -


i have question regarding requirement in elastic-search. have following documents in index.

{     "name":"a1",     "userid": 1,     "tag":"tag1" },  {     "name":"abc",     "userid":1,     "tag":"tag2" },  {     "name":"a2",     "userid":2,     "tag":"tag1" },  {     "name":"abc2",     "userid":2,     "tag":"tag2" },  {     "name":"abc3",     "userid":2,     "tag":"tag3" } 

now if query fetch me documents userid has tag values "tag1" , "tag3" i.e. in case documents returned

{     "name":"a2",     "userid":2,     "tag":"tag1" } {     "name":"abc3",     "userid":2,     "tag":"tag3" } 

so in case document containing tag values "tag1" userid 1 not returned userid not have document "tag3".

i checking on nested bucket aggregation stuck. can please suggest elastic query required this.


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -