I'm getting an error at design time "Cannot convert lambda expression to type 'PostData' because it is not a delegate type". I have referenced Elasticsearch and System.Linq.
I've managed to use the ElasticLowLevelClient successfully to Index, but if I use that to Count or Search since it seems to just do a post, I can't map the response object to actually use the data I'm trying to get.
Hi, so this is embarrassing. I was wanting to use the Low Level Client, but that was obviously not right. I then tried adding the Nest reference and changing to High Level Client but that didn't work either.
Then I closed VS Code, reopened it and all of a sudden it works. Frustrating!
For info, in case anyone else has this -
Running on Windows
Elasticsearch v6.3.0 running locally (just for dev purposes)
Developing in C# (dotnet core), using VSCode.
Code now looks like:
var node = new Uri(Config.Configuration["elasticsearch:0:uri"]);
var settings = new ConnectionSettings( node );
Client = new ElasticClient(settings);
QueryContainer query = new MatchQuery
{
Field = keyValue.Key,
Query = keyValue.Value.ToString()
};
var searchRequest = new SearchRequest(index.IndexName, index.IndexType)
{
Query = query
};
var searchResults = Client.Search<object>(searchRequest);
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.