在 OpenSearch 中获取 mapper_parsing_exception

Getting mapper_parsing_exception in OpenSearch

我是 OpenSearch 的新手,我正在遵循 here 提到的 POC 索引模式。

我正在尝试测试此处提到的映射:https://github.com/spryker/search/blob/master/src/Spryker/Shared/Search/IndexMap/search.json 在 OpenSearch 开发控制台中。


PUT testindex
{
    "settings": {
        "index": {
            "number_of_shards": 1,
            "number_of_replicas": 1
        },
        "analysis": {
            "analyzer": {
                "lowercase_keyword_analyzer": {
                    "tokenizer": "keyword",
                    "filter": ["lowercase"]
                },
                "suggestion_analyzer": {
                    "tokenizer": "standard",
                    "filter": ["lowercase"]
                }
            },
            "normalizer": {
                "lowercase_normalizer": {
                    "type": "custom",
                    "char_filter": [],
                    "filter": ["lowercase"]
                }
            }
        }
    },
    "mappings": {
        "page": {
            "dynamic_templates": [
                {
                    "search-result-data": {
                        "mapping": {
                            "index": "false"
                        },
                        "path_match": "search-result-data.*"
                    }
                },
                {
                    "string_sort": {
                        "mapping": {
                            "analyzer": "lowercase_keyword_analyzer",
                            "type": "keyword"
                        },
                        "path_match": "string-sort.*"
                    }
                },
                {
                    "integer_sort": {
                        "mapping": {
                            "type": "integer"
                        },
                        "path_match": "integer-sort.*"
                    }
                }
            ],
            "properties": {
                "search-result-data": {
                    "type": "object",
                    "include_in_all": false,
                    "properties": {}
                },
                "type": {
                    "type": "keyword",
                    "include_in_all": false
                },
                "store": {
                    "type": "keyword",
                    "include_in_all": false
                },
                "is-active": {
                    "type": "boolean",
                    "include_in_all": false
                },
                "active-from": {
                    "type": "date",
                    "include_in_all": false
                },
                "active-to": {
                    "type": "date",
                    "include_in_all": false
                },
                "locale": {
                    "type": "keyword",
                    "include_in_all": false
                },
                "full-text": {
                    "type": "text",
                    "include_in_all": false
                },
                "full-text-boosted": {
                    "type": "text",
                    "include_in_all": false
                },
                "string-facet": {
                    "type": "nested",
                    "include_in_all": false,
                    "properties": {
                        "facet-name": {
                            "type": "keyword"
                        },
                        "facet-value": {
                            "type": "keyword"
                        }
                    }
                },
                "integer-facet": {
                    "type": "nested",
                    "include_in_all": false,
                    "properties": {
                        "facet-name": {
                            "type": "keyword"
                        },
                        "facet-value": {
                            "type": "integer"
                        }
                    }
                },
                "completion-terms": {
                    "type": "keyword",
                    "include_in_all": false,
                    "normalizer": "lowercase_normalizer"
                },
                "suggestion-terms": {
                    "type": "text",
                    "include_in_all": false,
                    "analyzer": "suggestion_analyzer"
                },
                "string-sort": {
                    "type": "object",
                    "include_in_all": false,
                    "properties": {}
                },
                "integer-sort": {
                    "type": "object",
                    "include_in_all": false,
                    "properties": {}
                },
                "category": {
                    "type": "object",
                    "include_in_all": false,
                    "properties": {
                        "direct-parents": {
                            "type": "integer"
                        },
                        "all-parents": {
                            "type": "integer"
                        }
                    }
                }
            }
        }
    }
}

我遇到错误:


"type" : "mapper_parsing_exception",
"reason" : "Root mapping definition has unsupported parameters:  [page : {dynamic_templates=[{search-result-data={path_match=search-result-data.*, mapping={index=false}}}, {string_sort={path_match=string-sort.*, mapping={analyzer=lowercase_keyword_analyzer, type=keyword}}}, {integer_sort={path_match=integer-sort.*, mapping={type=integer}}}], properties={integer-facet={include_in_all=false, type=nested, properties={facet-value={type=integer}, facet-name={type=keyword}}}, full-text={include_in_all=false, type=text}, integer-sort={include_in_all=false, type=object, properties={}}, search-result-data={include_in_all=false, type=object, properties={}}, string-sort={include_in_all=false, type=object, properties={}}, suggestion-terms={include_in_all=false, analyzer=suggestion_analyzer, type=text}, completion-terms={include_in_all=false, normalizer=lowercase_normalizer, type=keyword}, is-active={include_in_all=false, type=boolean}, store={include_in_all=false, type=keyword}, type={include_in_all=false, type=keyword}, locale={include_in_all=false, type=keyword}, active-to={include_in_all=false, type=date}, string-facet={include_in_all=false, type=nested, properties={facet-value={type=keyword}, facet-name={type=keyword}}}, category={include_in_all=false, type=object, properties={all-parents={type=integer}, direct-parents={type=integer}}}, active-from={include_in_all=false, type=date}, full-text-boosted={include_in_all=false, type=text}}}]"

这没有帮助。谁能帮我找出真正的错误?

谢谢

您需要将 page 替换为 _doc(或将其完全删除),因为存在 no more mapping types

"mappings": {
    "_doc": {
        "dynamic_templates": [