I have an instance in which articles are stored which have various properties. But it may be that some items have no properties at all. There are countless properties and assigned values, all in random order.
Now the problem is that unfortunately it doesn't work the way I would like it to. The properties are respected, but it seems like the order of the properties is important. But it can be that there are a lot of properties in the entry in the instance and only 1-2 are queried in the search query and these can have minor deviations in the value.
The goal is to find entries that are as similar as possible, no matter the order of the properties.
Can anyone help me with this?
Elastic instance info:
"_index" : "articles",
"_type" : "_doc",
"_id" : "fYjaQXkBBdCju4scstN_",
"_score" : 1.0,
"_source" : {
"position" : "400.000",
"beschreibung" : "asc",
"menge" : 24.0,
"einheit" : "St",
"properties" : [
{
"desc" : "Farbe",
"val" : "rot"
},
{
"desc" : "Material",
"val" : "Holz"
},
{
"desc" : "Länge",
"val" : "20 cm"
},
{
"desc" : "Breite",
"val" : "100 km"
}
]
}
}
The nested part of my current query:
[nested] => Array
(
[path] => properties
[query] => Array
(
[0] => Array
(
[0] => Array
(
[bool] => Array
(
[should] => Array
(
[0] => Array
(
[match] => Array
(
[properties.desc] => Farbe
)
)
[1] => Array
(
[match] => Array
(
[properties.val] => rot
)
)
)
)
)
)
[1] => Array
(
[0] => Array
(
[bool] => Array
(
[should] => Array
(
[0] => Array
(
[match] => Array
(
[properties.desc] => Länge
)
)
[1] => Array
(
[match] => Array
(
[properties.val] => 22 cm
)
)
)
)
)
)
[2] => Array
(
[0] => Array
(
[bool] => Array
(
[should] => Array
(
[0] => Array
(
[match] => Array
(
[properties.desc] => Material
)
)
[1] => Array
(
[match] => Array
(
[properties.val] => Holz
)
)
)
)
)
)
)
)