【发布时间】:2020-04-07 16:33:27
【问题描述】:
我在 MySQL 中有一个很大的字段,不想将原始值保存到 ElasticSearch。有没有像 Lucene Field.Store.NO 这样的方法?
谢谢。
【问题讨论】:
标签: elasticsearch indexing lucene store
我在 MySQL 中有一个很大的字段,不想将原始值保存到 ElasticSearch。有没有像 Lucene Field.Store.NO 这样的方法?
谢谢。
【问题讨论】:
标签: elasticsearch indexing lucene store
您只需要相应地定义“store”映射,例如。 :
PUT your-index
{
"mappings": {
"properties": {
"some_field": {
"type": "text",
"index": true,
"store": false
}
}
}
}
您可能还想禁用 _source 字段:
#disable-source-field
_source 字段包含在索引时传递的原始 JSON 文档正文 [...] 虽然很方便,但 source 字段确实会在索引中产生存储开销。
因此,可以按如下方式禁用:
PUT your-index
{
"mappings": {
"_source": {
"enabled": false
}
}
}
【讨论】: