Elastic Search nested multimatch query

后端 未结 2 1644
谎友^
谎友^ 2020-12-31 02:27

So my problem is basically the same as described here, however it still remains unanswered on the group.

My mapping:

{
    \"abstract\": {
        \"         


        
2条回答
  •  醉酒成梦
    2020-12-31 03:19

    Changing your mapping to the following one which uses include_in_root: true will allow you to use the query you original wrote:

    {
        "abstract": {
            "properties": {
                "summary": {
                    "type": "string"
                }
            }
        },
        "authors": {
            "type": "nested",
            "include_in_root": true,
            "properties": {
                "first_name": {
                    "type": "string"
                },
                "last_name": {
                     "type": "string"
                }
            }
        }
    }
    

    You may want to index inner objects both as nested fields and as flattened object fields. This can be achieved by setting include_in_parent to true. - Link

    Note: include_in_root may be deprecated in future versions of elasticsearch in favor of copy_to.

提交回复
热议问题