Skip to content

Instantly share code, notes, and snippets.

@teanoon
Created July 18, 2023 05:34
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 teanoon/be17fc76a99460c6ec669222c76dbe60 to your computer and use it in GitHub Desktop.
Save teanoon/be17fc76a99460c6ec669222c76dbe60 to your computer and use it in GitHub Desktop.
{
"_source": {
"includes": [
"brandId",
"deals",
"description",
"name",
"retailerId",
"retailerProductId",
"uberId"
]
},
"from": 0,
"post_filter": {
"bool": {
"must": [
{
"bool": {
"minimum_should_match": 1,
"should": {
"term": {
"brandIds": 1242
}
}
}
},
{
"bool": {
"must": {
"term": {
"categoryIds": 2
}
}
}
}
]
}
},
"query": {
"boosting": {
"negative": {
"bool": {
"minimum_should_match": 1,
"should": {
"terms": {
"retailerId": [
// ...10 ids
]
}
}
}
},
"negative_boost": 0.6,
"positive": {
"bool": {
"filter": {
"bool": {
"minimum_should_match": 1,
"must": {
"match": {
"someTypes": {
"operator": "or",
"query": "en_GB-W"
}
}
},
"should": {
"bool": {
"must": {
"terms": {
"retailerId": [
// ...150 ids
]
}
},
"must_not": [
{
"bool": {
"minimum_should_match": 1,
"should": [
{
"bool": {
"must": [
{
"bool": {
"minimum_should_match": 1,
"should": {
"term": {
"brandIds": 20527
}
}
}
},
{
"term": {
"retailerId": 1231
}
}
]
}
},
{
"bool": {
"must": [
{
"bool": {
"minimum_should_match": 1,
"should": {
"terms": {
"brandIds": [
// ...20 ids
]
}
}
}
},
{
"term": {
"retailerId": 1
}
}
]
}
},
{
"bool": {
"must": [
{
"bool": {
"minimum_should_match": 1,
"should": {
"terms": {
"brandIds": [
// ...230 ids
]
}
}
}
},
{
"term": {
"retailerId": 8
}
}
]
}
},
{
"bool": {
"must": [
{
"bool": {
"minimum_should_match": 1,
"should": {
"terms": {
"brandIds": [
// ...50 ids
]
}
}
}
},
{
"term": {
"retailerId": 150
}
}
]
}
},
{
"bool": {
"must": [
{
"bool": {
"minimum_should_match": 1,
"should": {
"terms": {
"brandIds": [
// ...10 ids
]
}
}
}
},
{
"term": {
"retailerId": 105
}
}
]
}
},
{
"bool": {
"must": [
{
"bool": {
"minimum_should_match": 1,
"should": {
"terms": {
"brandIds": [
// ...10 ids
]
}
}
}
},
{
"term": {
"retailerId": 7
}
}
]
}
}
]
}
},
{
"bool": {
"minimum_should_match": 1,
"should": [
{
"bool": {
"must": [
{
"bool": {
"minimum_should_match": 1,
"should": {
"terms": {
"categoryTagText": [
"Beauty",
"Diamonds",
"Fur & Shearling",
"Gift Cards",
"Watches"
]
}
}
}
},
{
"term": {
"retailerId": 1
}
}
]
}
},
{
"bool": {
"must": [
{
"bool": {
"minimum_should_match": 1,
"should": {
"terms": {
"categoryTagText": [
"Beauty",
"Gift Cards"
]
}
}
}
},
{
"term": {
"retailerId": 8
}
}
]
}
}
]
}
},
{
"terms": {
"brandIds": [
319,
3133
]
}
}
]
}
}
}
},
"minimum_should_match": 0,
"should": {
"term": {
"someCountry": {
"boost": 0.001,
"value": "en_GB"
}
}
}
}
}
}
},
"size": 40,
"sort": [
{
"_score": "desc"
}
],
"timeout": "30000ms"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment