0
votes

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?

1
have you tried with port no 9300..? - BlackPOP
Can you please add your FeeQueryResult mapped class to the question as well. - Paige Cook
You can check the response object's ConnectionStatus to find the actual query that was sent to ElasticSearch, which you could then compare against your Sense query to figure out what's causing the difference. - Avish

1 Answers

1
votes

This was my fault.

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