什么是“ your_type”字段。在Elasticsearch put请求?

发布于 2025-01-21 20:59:38 字数 225 浏览 5 评论 0 原文

我正在尝试解决此错误:

FieldData默认情况下在文本字段上被禁用。在

上设置fieldData = true

并看到了一个建议我这样做的帖子;但是我没有得到给定代码中的 your_type 端点:

PUT your_index/_mapping/your_type

I am trying to resolve this error:

Fielddata is disabled on text fields by default. Set fielddata=true on

and saw one post which suggested me to do this; but I didn't get what is your_type endpoint in the given snippet:

PUT your_index/_mapping/your_type

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

笑梦风尘 2025-01-28 20:59:38

我不知道您拥有哪种版本的Elasticsearch,但截至7.x,映射类型已被删除。

在您的情况下,它可以像这样运行(版本> 7.x),

PUT my-index-000001/_mapping
{
  "properties": {
     "name-field": {
       "type": "text",
       "fielddata": true
     }
  }
}

以了解映射类型:

自Elasticsearch的第一个版本以来,每个文档都是
存储在一个索引中,并分配了单个映射类型。映射
类型用于表示文档的类型或实体的类型
索引,例如,Twitter索引可能具有用户类型和一个
推文类型。

每个映射类型都可以具有自己的字段,因此用户类型可能
拥有一个full_name字段,一个user_name字段和电子邮件字段,
推文类型可以具有内容字段,一个tweeted_at字段,以及
像用户类型一样,user_name字段。

这里更多信息:

I don't know what version of ElasticSearch you have but as of 7.x the mapping type has been removed.

In your case it could run like this (version > 7.x)

PUT my-index-000001/_mapping
{
  "properties": {
     "name-field": {
       "type": "text",
       "fielddata": true
     }
  }
}

A little about the mapping type:

Since the first release of Elasticsearch, each document has been
stored in a single index and assigned a single mapping type. A mapping
type was used to represent the type of document or entity being
indexed, for instance a twitter index might have a user type and a
tweet type.

Each mapping type could have its own fields, so the user type might
have a full_name field, a user_name field, and an email field, while
the tweet type could have a content field, a tweeted_at field and,
like the user type, a user_name field.

More information here:
https://www.elastic.co/guide/en/elasticsearch/reference/6.5/removal-of-types.html#_why_are_mapping_types_being_removed

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文