跨索引库搜索
mapping元数据字段
Metadata fields are used to customize how a document’s associated metadata is treated.
元数据字段用于自定义处理文档相关元数据
Identity metadata fields 身份元数据
_index
The index to which the document belongs. 文档所在索引库
_type
The document’s mapping type.
_id
The document’s ID. 文档唯一标识
注意 _index _id 可用于 query 查询
_index
查询,包括跨索引库查询,_bulk
查询,_mget
查询,_search
查询,_msearch
查询
PUT index_1/_doc/1
{
"text": "Document in index 1"
}
PUT index_2/_doc/2?refresh=true
{
"text": "Document in index 2"
}
GET index_1,index_2/_search
{
"query": {
"terms": {
"_index": ["index