[英]How to specify fields which should not be indexed in ElasticSearch
How do I specify the fields in ElasticSearch which I do not want to be indexed? 如何指定在ElasticSearch领域,我不想被索引? I read this SO question but I didn't understand its answers. 我读了这个问题,但我不明白它的答案。
Your mapping should be something like this: 您的映射应如下所示:
"index_name": {
"mappings": {
"type_name": {
"mappings": {
"properties": {
"unsearchable_field_name": {
"index": "no"
}
}
}
}
}
}
Notice that unsearchable_field_name
still may to be stored (depends on your dynamic mapping config, take a look into Dynamic Mapping ), but by setting index: no
, Elasticsearch ignores this field on search requests. 注意,仍然可以存储unsearchable_field_name
(取决于您的动态映射配置,请查看Dynamic Mapping ),但是通过设置index: no
,Elasticsearch在搜索请求时会忽略此字段。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.