我在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/