ElasticSearch NEST client not returning results

↘锁芯ラ 提交于 2019-11-30 07:10:54

NEST tries to guess the type and index name and in your case it will use /blog/blogentries

blog because that what you told the default index is and blogentries because it will lowercase and pluralize the type name you pass to Search<T>.

You can control which type and index like so:

 .Search<BlogEntry>(s=>s.AllIndices().Query(...));

This will let NEST know you actually want to search on all indices and so nest will translate it to /_search on the root, equal to the command you issued on curl.

What you most likely want is:

 .Search<BlogEntry>(s=>s.Type("posts").Query(...));

So that NEST searches in /blog/posts/_search

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!