【问题标题】:I get no hits in the response我没有得到回应
【发布时间】:2018-04-17 21:59:28
【问题描述】:

NEST 客户端向该 URL 发送请求:

http://localhost:9200/myindex/product/_search?typed_keys=true

这不会返回任何结果。

但是如果我向这个 URL 发送一个 HTTP 请求:

http://localhost:9200/myindex/_search?typed_keys=true

然后我得到结果。为什么是这样?我索引错了吗?

NEST 版本: 6.0.2

Elasticsearch 版本: 6.2.3

【问题讨论】:

  • 你有没有尝试请求localhost:9200/myindex/product/_search
  • @ThanhLD 我做到了。没有结果。如果我删除 /product 那么我会得到结果。 /myindex 代表我的索引的名称。 /product 代表什么?我的索引中的文档类型?

标签: elasticsearch nest


【解决方案1】:

发现了。以防将来有人遇到同样的问题。

当我为我的文档编制索引时,“模型”名称是“producthomepagemodel”,但在我查询索引的应用程序中,我使用模型“产品”。这些模型具有相同的属性,但类名不同。现在可以了。

【讨论】:

猜你喜欢
  • 2022-01-11
  • 2020-02-18
  • 1970-01-01
  • 2022-11-22
  • 2018-10-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多