문제

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