gpt4 book ai didi

elasticsearch - 在Elasticsearch 5.6中使嵌套字段不可搜索

转载 作者:行者123 更新时间:2023-12-03 01:39:37 25 4
gpt4 key购买 nike

我有一个嵌套在其他字段内的字段,我想使该字段不可搜索,我的映射如下所示

dataset": {
"properties": {
"identifier": {
"type": "text"
},
"title": {
"type": "text",
"term_vector" : "with_positions_offsets"
},
"description": {
"type": "text"
},
"refinement": {
"type": "text"
},
"isAbout": {
"type": "text"
},
"primaryPublications": {
"type": "text"
},
"aggregation": {
"type": "text",
"include_in_all": false,
"store": "no"
},
"availability": {
"type": "text",
"include_in_all": false
}
}

}

当我使用curl命令获取映射时,我仍然可以将标记为include_in_all为false的字段保留下来。还有其他方法可以使该字段不可搜索。

最佳答案

我使用了属性的“enabled

Elasticsearch tries to index all of the fields you give it, but sometimes you want to just store the field without indexing it


PUT my_index
{
"mappings": {
"_doc": {
"properties": {
"user_id": {
"type": "keyword"
},
"last_updated": {
"type": "date"
},
"session_data": {
"enabled": false
}
}
}
}
}

关于elasticsearch - 在Elasticsearch 5.6中使嵌套字段不可搜索,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48895927/

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