5

I'm encountering an unexpected error when I try to perform a search on an ElasticSearch instance. I'm following the documentation here (http://nest.azurewebsites.net/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")
    )
 );
Sc0rpio
  • 189
  • 2
  • 4
  • 12

1 Answers1

0

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.

Orkun Bekar
  • 1,447
  • 1
  • 15
  • 36