Skip to content

Instantly share code, notes, and snippets.

@prashanttct07
Created April 27, 2019 11:49
Show Gist options
  • Save prashanttct07/f51d6af903c158bf263692c41c24c9e2 to your computer and use it in GitHub Desktop.
Save prashanttct07/f51d6af903c158bf263692c41c24c9e2 to your computer and use it in GitHub Desktop.
POST catalogstagingv4/_search
{
"size": 50,
"sort": [
"_score",
{
"catalog.unitPrice": "asc"
}
],
"query": {
"bool": {
"should": [
{
"multi_match": {
"query": "Gloves small powder free nitrile",
"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"
]
}
}
],
"filter": [
{
"terms": {
"catalog.manufacturerName.keyword": [
"Ansell"
]
}
},
{
"terms": {
"catalog.pkg.keyword": [
"CS"
]
}
},
{
"multi_match": {
"query": "Gloves>Nitrile/Synthetic>Exam/Non-sterile",
"fields": [
"catalog.categoryPathName"
]
}
}
]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment