Created
October 18, 2013 16:57
-
-
Save clintongormley/7044461 to your computer and use it in GitHub Desktop.
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
POST /documents/_search | |
{ | |
"query": { | |
"bool": { | |
"must": { | |
"function_score": { | |
"query": { | |
"has_child": { | |
"type": "comment", | |
"score_type": "sum", | |
"boost": 1, | |
"query": { | |
"filtered": { | |
"query": { | |
"constant_score": { | |
"query": { | |
"match": { | |
"text": "Finally!" | |
} | |
} | |
} | |
}, | |
"filter": { | |
"range": { | |
"date": { | |
"lte": 20130204, | |
"gte": 20130201 | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"boost": "1", | |
"script_score": { | |
"params": { | |
"cutoff": 1 | |
}, | |
"script": "_score < cutoff ?-1:1" | |
}, | |
"boost_mode": "mult" | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment