gpt4 book ai didi

node.js - 路径 ['somepath' 下的嵌套对象] 不是嵌套类型

转载 作者:行者123 更新时间:2023-12-04 17:11:39 24 4
gpt4 key购买 nike

当我尝试查询数据时出现以下错误

错误

[nested] 路径 [existing_contacts] 下的嵌套对象不是嵌套类型

索引中的数据

{
"_index" : "memoreasecontacts",
"_type" : "_doc",
"_id" : "614d6f0b2a05640008d09109",
"_score" : 1.0,
"_source" : {
"id" : "614d6f0b2a05640008d09109",
"existing_contacts" : [
{
"is_profile_completed" : true,
"friend_status" : "pending",
"email_verified" : false,
"gender" : "Male",
"is_new_signup" : "true",
"religious_id" : [
{
"religious" : "Hinduism",
"id" : "5db7d2a36a57364618c57efe"
}
],
"email_token" : "VZs37yfesXbCsRuWGJPqgZxVn1Xz55Qh",
"profileImage" : "uploads/userimage.png",
"deviceId" : [ ],
"friend_owner" : "receiver",
"blocked_status" : false,
"lastname" : "Shahbaz",
"password" : "$F0EaWeYX=d5#Q3Jld2xvZ2l4QDE=",
"mobile_verified" : true,
"created_on" : "2021-09-24T12:49:24.674Z",
"dob" : "2021-09-24T00:00:00.000Z",
"selfinformation" : "Testing app",
"firtsname" : "Umer",
"id" : "614dc95412b8c0000903cd5c",
"email" : "m.haris+10@crewlogix.com",
"username" : "UmerShahbaz"
}
],
"new_contacts" : [ ]
}
}

查询

"query": {
"bool": {
"must": [
{
"term": {
"_id": {
"value": "614d6f0b2a05640008d09109"
}
}
},
{
"nested": {
"ignore_unmapped": true,
"path": "existing_contacts",
"query": {
"bool": {
"must": [
{
"match": {
"existing_contacts.friend_status": "pending"
}
},
{
"match": {
"existing_contacts.friend_owner": "receiver"
}
}
]
}
},
"inner_hits": {
"size": "1",
"from": "0",
"highlight": {
"fields": {
"existing_contacts.username": {},
"existing_contacts.friend_status": {}
}
}
}
}
}
]
}
}

附言

这之前是有效的。 AWS Elasticsearch 域已关闭,我必须将其替换为新域。现在收到此错误。任何帮助,将不胜感激。提前致谢。

映射

{
"memoreasecontacts" : {
"aliases" : { },
"mappings" : {
"properties" : {
"existing_contacts" : {
"properties" : {
"blocked_status" : {
"type" : "boolean"
},
"created_on" : {
"type" : "date"
},
"dob" : {
"type" : "date"
},
"email" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"email_token" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"email_verified" : {
"type" : "boolean"
},
"firtsname" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"friend_owner" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"friend_status" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"gender" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"id" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"is_new_signup" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"is_profile_completed" : {
"type" : "boolean"
},
"lastname" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"mobile" : {
"type" : "long"
},
"mobile_verified" : {
"type" : "boolean"
},
"password" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"profileImage" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"religious_id" : {
"properties" : {
"id" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"religious" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
}
}
},
"selfinformation" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"username" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
}
}
},
"id" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
}
}
},
"settings" : {
"index" : {
"creation_date" : "1632463671805",
"number_of_shards" : "5",
"number_of_replicas" : "1",
"uuid" : "ckUxjK5wQoOiagEINEwb0w",
"version" : {
"created" : "7040299"
},
"provided_name" : "memoreasecontacts"
}
}
}
}

最佳答案

您需要为您的索引创建一个映射。该映射可以应用于索引创建或抛出一个索引模板。索引模板 您也可以使用 kibana 手动完成。通过菜单 Stack management->Index management->index template

关于node.js - 路径 ['somepath' 下的嵌套对象] 不是嵌套类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69316193/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com