Hi, elastic index all product prices booth per pricelist and per country. So a ProductDocument.Prices looks like this.
{
"systemId" : "935ee8b1-c12f-45a4-b183-9f3a968461f3",
"countrySystemId" : "31418f63-5108-440d-a07a-daea8d5296fa",
"isCampaignPrice" : false,
"price" : 173.6
},
{
"systemId" : "935ee8b1-c12f-45a4-b183-9f3a968461f3",
"countrySystemId" : "c6c883f8-c679-423a-9af0-8d3837ea0b88",
"isCampaignPrice" : false,
"price" : 175.0
},
{
"systemId" : "ead1d6cc-da76-43a6-b616-1493c1de2446",
"countrySystemId" : "cb7048a5-0afa-48be-8995-533865c452ca",
"isCampaignPrice" : false,
price" : 0.0
}
Some language/lists dose not have a price (note the last object).
So when ordering my search results by min-price this product will be first on all languages/channels?
This is what the query look like (below). Am i doing somthing wrong? or should the code not include the language and default/current pricelist id in the query somehow?
It feels like am missing somthing or the price filter is broken? Look at the “sort” section below when sorting a default category.
GET /elevennf-v1productdocument.sv-se/_search {
"query": {
"bool": {
"filter": [
{
"term": {
"channelSystemId": {
"value": "baa772ef-f705-4765-82ad-686560a35e6a",
"boost": 1
}
}
},
{
"term": {
"assortments": {
"value": "15d7b6d8-fd0b-4e5c-5ef9-08d6e1f51a46",
"boost": 1
}
}
},
{
"term": {
"organizations": {
"value": "00000000-0000-0000-0000-000000000000",
"boost": 1
}
}
},
{
"term": {
"parentCategories": {
"value": "d2090375-650f-48a9-b7ca-194886907624",
"boost": 1
}
}
},
{
"bool": {
"should": [
{
"term": {
"permissions": {
"value": "Group:5b521f8c-a7a2-44e0-ab76-1c60d740bded",
"boost": 1
}
}
},
{
"term": {
"permissions": {
"value": "Group:3bb00cc4-a86f-4d5d-b43a-aed35d4ecab5",
"boost": 1
}
}
}
],
"adjust_pure_negative": true,
"boost": 1
}
}
],
"adjust_pure_negative": true,
"boost": 1
} },
"sort": [
{
"prices.price": {
"order": "asc",
"mode": "min",
"nested": {
"path": "prices"
}
}
},
{
"name.keyword": {
"order": "asc"
}
},
{
"articleNumber": {
"order": "asc"
}
}
]
}
Litium version: 7.4