我在 Elasticsearch 中存储一些文档,分为两列:
id | data
--- -----
(int) json string
我应该使用什么映射来要求 Elasticsearch 只存储 json 字符串而不对其进行任何处理?为了提高效率,我不希望该列被索引或可搜索 - 只是希望 ES 将其存储为位。
最佳答案
使用"index": "no"
在该字段的映射中。
所以也许是这样的:
PUT /test_index
{
"settings": {
"number_of_shards": 1,
"number_of_replicas": 1
},
"mappings": {
"doc": {
"properties": {
"id": {
"type": "integer"
},
"json_string": {
"type": "string",
"index": "no"
}
}
}
}
}
关于java - 如何在没有任何索引的情况下在 Elasticsearch 中存储一些位?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28491304/