Skip to content

Instantly share code, notes, and snippets.

@prashanttct07
Last active April 26, 2019 10:41
Show Gist options
  • Save prashanttct07/fd3b83973ec36c71a65e1b3b03ee3cb9 to your computer and use it in GitHub Desktop.
Save prashanttct07/fd3b83973ec36c71a65e1b3b03ee3cb9 to your computer and use it in GitHub Desktop.
Main query without category filter
{
"sort": [
"_score",
{
"catalog.unitPrice": "asc"
}
],
"query": {
"bool": {
"should": [
{
"multi_match": {
"query": "Gloves small powder free",
"type": "phrase_prefix",
"fields": [
"sizes.whitespace"
],
"boost": 10
}
},
{
"multi_match": {
"query": "Gloves small powder free",
"type": "phrase",
"fields": [
"sizes.whitespace"
],
"slop": 3,
"boost": 8
}
},
{
"multi_match": {
"query": "Gloves small powder free",
"type": "best_fields",
"fields": [
"sizes.whitespace"
],
"boost": 8
}
},
{
"multi_match": {
"query": "Gloves small powder free",
"type": "phrase_prefix",
"fields": [
"catalog.itemDescription",
"catalog.productName",
"catalog.manufacturerName",
"catalog.productDescription"
],
"boost": 5
}
},
{
"multi_match": {
"query": "Gloves small powder free",
"type": "phrase",
"fields": [
"catalog.itemDescription",
"catalog.productName",
"catalog.manufacturerName",
"catalog.productDescription"
],
"slop": 3
}
},
{
"multi_match": {
"query": "Gloves small powder free",
"type": "best_fields",
"fields": [
"catalog.itemDescription",
"catalog.productName",
"catalog.manufacturerName",
"catalog.productDescription"
]
}
}
]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment