elasticsearch - ElasticSearch只能添加字段索引,而不能像lucene Field.Store.NO一样保存原始值

标签 elasticsearch indexing lucene store

我在MySQL中有一个很大的字段,并且不想将原始值保存到ElasticSearch。有没有像Lucene Field.Store.NO一样的方法?
谢谢。

最佳答案

您只需要相应地定义“store”映射,例如。 :

PUT your-index
{
  "mappings": {
    "properties": {
      "some_field": {
        "type": "text",
        "index": true,
        "store": false
      }
    }
  }
}

您可能还想禁用_source字段:

#disable-source-field
The _source field contains the original JSON document body that was passed at index time [...] Though very handy to have around, the source field does incur storage overhead within the index.



因此,可以如下禁用它:
PUT your-index
{
  "mappings": {
   "_source": {
      "enabled": false
    }
  }
}

关于elasticsearch - ElasticSearch只能添加字段索引,而不能像lucene Field.Store.NO一样保存原始值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59335843/

相关文章:

java - 如何在 lucene 中赋予元音变音更多的权重?

java - solr autoSoftCommit 将打开新的搜索器?

elasticsearch - Elasticsearch发布荧光笔返回太多句子

ElasticSearch 多匹配查询 cross_fields 类型

python - 使用模式迭代列表中的项目?

xml - SQL 服务器 : Order by XML column's node

elasticsearch - Kibana 不需要的千位分隔符

elasticsearch - Elastic Search 始终返回分数为零

c# - 使用内置 SQL 函数编译的 Linq 查询

java - "-"字符的 Lucene 索引问题