Skip to content

Instantly share code, notes, and snippets.

@clintongormley
Created August 11, 2011 08:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clintongormley/1139183 to your computer and use it in GitHub Desktop.
Save clintongormley/1139183 to your computer and use it in GitHub Desktop.
curl -XGET 'http://127.0.0.1:9200/_all/_search?pretty=1' -d '
{
"query" : {
"custom_filters_score" : {
"query" : {
"constant_score" : {
"filter" : {
"and" : [
{ "term" : { "adultContent" : 0 }},
{ "term" : { "locid" : 14648 }},
{ "terms" : { "portalid" : [1,2] }}
]
}
}
},
"filters" : [
{
"boost" : 50000,
"filter" : {
"and" : [ { "term" : { "isCustomer" : 1 }},
{ "term" : { "tagid" : 1959 }}
]
}},
{
"boost" : 25000,
"filter" : { "term" : { "isCustomer" : 1 }}
},
{
"boost" : 5000,
"filter" : {
"or" : [ { "term" : { "catid" : "L929" }},
{ "query": {
"text" : { "companyName" : "hotel" }
}}
]
}},
{
"boost" : 1,
"filter" : {
"query" : {
"text" : { "_all" : "hotel" }
}}
}
]
}
}
}
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment