Hi,
I've the following nested index structure:
"sector_parametric": [
{
"sector": [
"2"
],
"experience": 1.7,
"adv_business_sector_id": "637"
},
{
"sector": [
"1",
"2",
"10003"
],
"experience": 2.7,
"adv_business_sector_id": "642"
}]
I want to show the documents with the sector value is 1 AND 2, BUT not necessarily in one nested object, so
the following document would be perfect
"sector_parametric": [
{
"sector": [
"1"
],
"experience": 1.7,
"adv_business_sector_id": "637"
},
{
"sector": [
"2",
"10003"
],
"experience": 2.7,
"adv_business_sector_id": "642"
}]
If I filter with the following query, there will be only documents where one nested sector object contains BOTH 1 AND 2:
[query] => Array
(
[bool] => Array
(
[filter] => Array
(
[bool] => Array
(
[must] => Array
(
[0] => Array
(
[nested] => Array
(
[path] => sector_parametric
[query] => Array
(
[bool] => Array
(
[must] => Array
(
[0] => Array
(
[term] => Array
(
[sector_parametric.sector] => 1
)
)
)
)
)
)
)
[1] => Array
(
[nested] => Array
(
[path] => sector_parametric
[query] => Array
(
[bool] => Array
(
[must] => Array
(
[0] => Array
(
[term] => Array
(
[sector_parametric.sector] => 2
)
)
)
)
)
)
)
)
)
)
)
)