Hi manticore community,
I’ve got troubles finding a way to do what i need using manticore, i’m sorry this is a bit complex and i really hope someone will be able to help me
I have a products index that looks like this :
'product_id' => ['type' => 'bigint'],
'options_combination' => ['type' => 'json'],
'sku' => ['type' => 'string'],
'weight' => ['type' => 'float'],
'created_at' => ['type' => 'timestamp'],
'updated_at' => ['type' => 'timestamp'],
'images' => ['type' => 'json'],
'categories' => ['type' => 'json'],
'prices' => ['type' => 'json'],
And the dataset looks like this as an example :
'product_id' => 1,
'options' => [
{"option_id":1,"option_value_id":1},
{"option_id":2,"option_value_id":6}
],
'sku' => "453-F6H-2",
'weight' => 1.970000,
'created_at' => 1679945503,
'updated_at' => 1679945503,
'images' => [
{
"id":19,"imageable_id":1,"imageable_type":"App\\Models\\Product","absolute_path":"https://minio.laravel.docker/products/1/2/6/2274.webp","created_at":"1679945503","updated_at":"1679945503"
},
{
"id":20,"imageable_id":1,"imageable_type":"App\\Models\\Product","absolute_path":"https://minio.laravel.docker/products/1/2/6/22744.jpeg","created_at":"1679945503","updated_at":"1679945503"
}
],
'categories' => [
{
"id":1,"name":"Clothing","created_at":"1679945503","updated_at":"1679945503",
},
{
"id":2,"name":"T-shirt","created_at":"1679945503","updated_at":"1679945503",
}
],
'prices' => [
{
"id":1,"currency_id":1,"country_id":1,"product_id":1,"without_taxes":22.700000,"created_at":"1679945503","updated_at":"1679945503"
},
{
"id":2,"currency_id":2,"country_id":1,"product_id":1,"without_taxes":89.700000,"created_at":"1679945503","updated_at":"1679945503"
},
{
"id":3,"currency_id":3,"country_id":1,"product_id":1,"without_taxes":99.600000,"created_at":"1679945503","updated_at":"1679945503"
},
{
"id":4,"currency_id":1,"country_id":2,"product_id":1,"without_taxes":83.900000,"created_at":"1679945503","updated_at":"1679945503"
},
{
"id":5,"currency_id":2,"country_id":2,"product_id":1,"without_taxes":63.500000,"created_at":"1679945503","updated_at":"1679945503"
},
{
"id":6,"currency_id":3,"country_id":2,"product_id":1,"without_taxes":100,"created_at":"1679945503","updated_at":"1679945503"
},
{
"id":7,"currency_id":1,"country_id":3,"product_id":1,"without_taxes":49.900000,"created_at":"1679945503","updated_at":"1679945503"
}
]
What i want to do is sort the products according to the without_taxes
field, if currency_id = 1 AND country_id = 1
.
I hope this will be explained enough for someone to understand my problem
Thanks !