【问题标题】:how do I store some bits in elastic search without any indexing?如何在没有任何索引的情况下在弹性搜索中存储一些位?
【发布时间】:2015-02-13 01:55:31
【问题描述】:

我在弹性搜索中存储了一些文档,包含 2 列:

id     | data
---      -----
(int)    json string

我使用什么映射来要求弹性搜索只存储 json 字符串而不对其进行任何处理?为了提高效率,我不希望该列被索引或可搜索 - 只希望 ES 将其存储为位。

【问题讨论】:

    标签: java json database elasticsearch


    【解决方案1】:

    在该字段的映射中使用"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"
                }
             }
          }
       }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-08-20
      • 1970-01-01
      • 2019-05-03
      • 2016-03-23
      • 2020-03-06
      相关资源
      最近更新 更多