I'm trying to query an elastic search index using a match_all query.

Uri uri = new Uri("http://10.10.10.67:9200");
ConnectionSettings connection = new ConnectionSettings(uri); 
connection.SetDefaultIndex("leases");
int port = connection.Port;

ElasticClient client = new ElasticClient(connection);

var feeQueryObject = client.Search<FeeQueryResult>(s => s
     .Type("leases").MatchAll());

Using sense, I get results but not with NEST.

Not sure if I have to set up my mapped class exactly how the schema is in the ElasticSearch document? - I only have a few properties in my class, not all of them.

Any ideas as to why there are no results returned?

有帮助吗?

解决方案

This was my fault.

The type was incorrect. Should be 'fee' not 'leases'.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top