【发布时间】:2015-06-16 03:51:21
【问题描述】:
我只搜索几个字段,但我希望能够将整个文档存储在 ES 中,以免额外的 DB (MySQL) 查询。
我尝试将index: no、store: no 添加到映射中的整个对象/属性,但我仍然不确定这些字段是否被索引并增加了不必要的开销。
假设我有书,每本书都有一个作者。我只想按书名搜索,但我希望能够检索整个文档。
这样好吗:
mappings:
properties:
title:
type: string
index: analyzed
author:
type: object
index: no
store: no
properties:
first_name:
type: string
last_name:
type: string
或者我应该这样做:
mappings:
properties:
title:
type: string
index: analyzed
author:
type: object
properties:
first_name:
index: no
store: no
type: string
last_name:
index: no
store: no
type: string
或者我做错了?
那么不应索引的nested 属性呢?
【问题讨论】:
标签: elasticsearch mapping