Created
September 3, 2012 04:59
-
-
Save vibindhas/3606794 to your computer and use it in GitHub Desktop.
facet filter for multi array field
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
authordetailsarray.authornamearray.notanalyzed is a not Analyzed field, has values as ["aaaa","bbbb"] | |
my search and facet filter is... | |
{ | |
"from" : 0, | |
"size" : 10, | |
"query" : {"bool":{"must":{"bool":{"should":[{"query_string":{"query":"aaaa","fields":["content"],"use_dis_max":true}}}}}}, | |
"facets" : { | |
"count" : { | |
"terms" : { | |
"field" : "authordetailsarray.authornamearray.notanalyzed", | |
"size" : 2000 | |
}, | |
"facet_filter" : { | |
{ | |
"and" : { | |
"filters" : [ { | |
"term" : { | |
"authordetailsarray.authornamearray.notanalyzed" : "xxxx" | |
} | |
} ] | |
} | |
} | |
} | |
} | |
} | |
} | |
when I apply the facet, I am getting the facet result as... | |
aaaa - 1 | |
bbbb - 1 | |
for my case I need only | |
aaaa - 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment