elasticsearch ElasticSearch只能添加字段索引,不能像lucene field.Store.no那样保存原始值吗,elasticsearch,indexing,lucene,store,elasticsearch,Indexing,Lucene,Store" /> elasticsearch ElasticSearch只能添加字段索引,不能像lucene field.Store.no那样保存原始值吗,elasticsearch,indexing,lucene,store,elasticsearch,Indexing,Lucene,Store" />

elasticsearch ElasticSearch只能添加字段索引,不能像lucene field.Store.no那样保存原始值吗

elasticsearch ElasticSearch只能添加字段索引,不能像lucene field.Store.no那样保存原始值吗,elasticsearch,indexing,lucene,store,elasticsearch,Indexing,Lucene,Store,我在MySQL中有一个较大的字段,不想将原始值保存到ElasticSearch。有没有像LuceneField.Store.NO那样的方法? 谢谢。您只需要相应地定义“”映射,例如: PUT your-index { "mappings": { "properties": { "some_field": { "type": "text", "index": true, "store": false } }

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

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

PUT your-index
{
  "mappings": {
    "properties": {
      "some_field": {
        "type": "text",
        "index": true,
        "store": false
      }
    }
  }
}
您可能还想禁用
\u源
字段:


_source字段包含在索引时传递的原始JSON文档体[…],尽管非常方便,但source字段确实会在索引中产生存储开销

因此,可以按如下方式禁用它:

PUT your-index
{
  "mappings": {
   "_source": {
      "enabled": false
    }
  }
}