Created
July 6, 2016 19:38
-
-
Save chrislerum/f8569dd37d1a279ee88383343e9cfc85 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
how to structure builder so filter requires both hidden be false AND approved be true? | |
right now, 'approved' just replaces the 'hidden' line. | |
query = Jbuilder.encode do |json| | |
json.query do | |
json.multi_match do | |
json.query term | |
json.fields ['title^2', 'description', 'tags.name'] | |
end | |
end | |
json.filter do | |
json.term hidden: false | |
json.term approved: true | |
end | |
end |
This file contains hidden or 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
"{\"query\":{\"multi_match\":{\"query\":\"michigan\",\"fields\":[\"title^2\",\"description\",\"tags.name\"]}},\"filter\":{\"term\":{\"approved\":true}},\"aggs | |
\":{\"tags\":{\"terms\":{\"field\":\"tags.name\"}}}}" | |
# 'approved' shows up but not 'hidden' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment