How to write inner_hits for my nested query?


(maral) #1

i have created a mapping like this :
'mappings' => [

            'my_type' => [
                'properties' => [
                    'folder_applications' => [
                        'type' => 'nested',
                        "properties" => [
                            "folder" => [
                                "type" => "nested",
                                "properties" => [
                                    "employer_id" => [
                                        "type" => "long"
                                    ],
                                    "id" => [
                                        "type" => "long"
                                    ]
                                ]
                            ],
                            "hire_stage_id" => [
                                "type" => "long"
                            ],
                            "is_applied" => [
                                "type" => "long"
                            ],
                            "status_id" => [
                                "type" => "long"
                            ]
                        ]
                    ],

                ]
            ]
        ]

my question is how can i write nested inner_hits for this?
for example i want search in folder for "id" field and in folder_applications for "status_id" field..

i tried many ways and search in documents and read other user problems.. but i couldn't write my own..

can anyone help me in this?

thanks with advanced.


(Clinton Gormley) #2

You need to be clearer about what you are asking, and make it easier to answer.

Provide a recreation of what you are doing that can be copied and pasted into the Console, to create the index, index some documents, and then show what query you are trying. Explain why your query isn't doing what you want, and explain exactly what you are trying to achieve.

Without this information, nobody is likely to answer


(system) #3

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