弹性搜索NEST搜索

编程入门 行业动态 更新时间:2024-10-26 08:25:11
本文介绍了弹性搜索NEST搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

当我尝试在ElasticSearch实例上执行搜索时,遇到意外的错误。我在这里遵循文档( nest.azurewebsites/nest/quick-start.html )逐字,但我得到错误错误1无法将lambda表达式转换为类型Nest.SearchDescriptor,因为它不是委托类型。s => s的第一个被突出显示。也许这只是一个C#语法问题,任何想法?

I'm encountering an unexpected error when I try to perform a search on an ElasticSearch instance. I'm following the documentation here (nest.azurewebsites/nest/quick-start.html) verbatim, but I"m getting the error "Error 1 Cannot convert lambda expression to type 'Nest.SearchDescriptor' because it is not a delegate type." The first s of "s => s" is being highlighted. Maybe it's just a C# syntax issue. Any ideas?

var searchResults = client.Search<Person>(s=>s .From(0) .Size(10) .Query(q=>q .Term(p=>p.Firstname, "martijn") ) );

推荐答案

你的问题可能是关于字符的情况,如果将FirstName字段添加到Person对象中,那么需要在lambda表达式中将其写为FirstName not Firstname。

I had the same problem. Your problem is probably about character case. If you add FirstName field to Person object, then you need to write it as FirstName not Firstname, inside the lambda expression.

更多推荐

弹性搜索NEST搜索

本文发布于:2023-11-30 00:32:18,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1648125.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:弹性   NEST

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!