Dear All!
I have some docs:
{"field_A":"aaa","field_B":"bbb"}
{"field_A":"aaa","field_B":"ccc"}
{"field_A":"bbb","field_B":"bbb"}
{"field_A":"bbb","field_B":"bbb"}
{"field_A":"bbb","field_B":"eee"}
{"field_A":"aaa","field_B":"aaaa"}
{"field_A":"ccc","field_B":"aaaa"}
first step:
{
"query":{
"filtered" : {
"filter" : {
"bool" : {
"must" : {
"term" : { "field_B" : "bbb" }
}
}
}
}
},
"facets" : {
"tag" : {
"terms" : {
"field" : "field_A"
}
}
}
}
first result:
{
...
{"term":"aaa","count":1},
{"term":"bbb","count":2},
...
}
-------------------------------------------------------------------------
second step:
the second facets:
{
"query":{
"filtered" : {
"filter" : {
"bool" : {
"must" : {
"term" : { "field_B" : "aaaa" }
}
}
}
}
},
"facets" : {
"tag" : {
"terms" : {
"field" : "field_A"
}
}
}
}
second result:
{
...
{"term":"aaa","count":1}.
{"term":"ccc","count":1}
...
}
-----------------------------------------------------------------------------
third step:
combine the two result with interesction operation with "term":
{"term":"aaa","count":"I don't care the count value."}

-----------------------------------------------------------------------------
Now, How can i combine the three steps in one filter facets or othen
method??


Thx All!!

-- 
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/53BA75D9.1080502%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to