多场映射弹性搜索 [英] multi field mapping elasticsearch

查看:148
本文介绍了多场映射弹性搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在弹性搜索中映射一个多字段

I'm trying to map a multi field in elasticsearch


  • 第一个字段 - 'in'应该包含所有索引列, / li>
  • 第二个字段 - 'orig'应该包含正文。

例如:

    "findings": {
       "type": "multi_field",
       "fields": {
          "in": {
             "type": "string"
          },
          "orig": {
             "type": "string",
             "index":"not_analyzed"
          }
       }

一旦我创建这个和查询这是它的外观。

Once I create this and query this is how it looks.

当index ='否'是否意味着该字段永远不会被索引?

When index = 'no' does it mean the field will never be indexed at all?

  "findings": {
                  "type": "string",
                  "index": "no",
                  "fields": {
                     "in": {
                        "type": "string"
                     },
                     "orig": {
                        "type": "string",
                        "index": "not_analyzed"
                     }
                  }


推荐答案

index:no对不同类型有不同的含义。由于您的问题中发现字段是 String 根据 elasticsearch documentation

"index" : "no" has got different meaning for different types. Since findings field in your question is String it has following meaning according to elasticsearch documentation.


不表示它根本不可搜索(作为单个字段,它可能仍然包含在内)在所有)。设置为no禁用include_in_all。

no means that it won’t be searchable at all (as an individual field; it may still be included in _all). Setting to no disables include_in_all.

您不能直接搜索调查结果因为它有 index:no ,而您可以使用 findings.in 发现.orig

you can not directly search for the field findings as it has got index: no while you can search it using findings.in or findings.orig

您可以学习更多关于 index property here

You can study more about index property here

这篇关于多场映射弹性搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆