Question

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?

Était-ce utile?

La solution

This was my fault.

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

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top