Two step inner_hits, and combine that with bool queries... that is not in nested type

i have a mapping like this :
`

 'candidate_cvs' => [
    'properties' => [
'folder_applications' => [
    'type' => 'nested',
    "properties" => [
        "created_at" => [
            "type" => "date"
        ],
        "employer_folder_id" => [
            "type" => "long"
        ],
        "folder" => [
            "type" => "nested",
            "properties" => [
                "employer_id" => [
                   "type" => "long"
                   ],
                   "id" => [
                        "type" => "long"
                    ]
                ]
            ],
            "hire_stage_id" => [
               "type" => "long"
            ],
            "is_applied" => [
                "type" => "long"
            ],
            "status_id" => [
                "type" => "long"
            ]
       ]
    ],
]

]
so i want to search inside my type, using nested query and bool query.. this is the query that i wrote: `

"query" => [
        "bool" => [
            "must" => [
                
                "query" => [
                    "nested" => [
                        "path" => "folder_applications",
                        "query" => [
                            "nested" => [
                                "path" => "folder_applications.folder",
                                "query" => [
                                    "match" => ["folder_applications.folder.id" => 7937]
                                ]
                            ],

                            [
                                "match" => ["folder_applications.status_id" => 141]
                            ]
                        ]
                    ]
                ]

            ],
            "must_not" => $this->mustNot,
            "filter" => $this->filter
        ]
    ],

`

but its get me error.. i dont know how to combine my queries..
no [query] registered for [query]

You don't need the query after the must.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.