Skip to content

Instantly share code, notes, and snippets.

@tomasfejfar
Created July 3, 2013 19:12
Show Gist options
  • Save tomasfejfar/5921817 to your computer and use it in GitHub Desktop.
Save tomasfejfar/5921817 to your computer and use it in GitHub Desktop.
dataQuery = {
"query" : {
"custom_filters_score" : {
"query" : {
"match" : { "_all" : query }
},
"filters" : [
{
"filter" : { "term" : {"_type" : "ticket"} },
"boost" : 1.5
}
]
}
},
"facets" : {
"project_id" : {
"terms" : {
"field" : "project_name",
"size" : 10
}
}
}
};
if (facet !== undefined) {
console.log(dataQuery);
dataQuery.query.custom_filters_score.filters.push({
"filter" : { "term" : {"project_name" : facet} },
"boost" : 10
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment