SOLVED: The URI was incorrect. Was "h||p://#.#.#.#/:9200" and should have been "h||p://#.#.#.#:9200". This was causing the API to change the port number to 80. Surprised the API actually was able to connect to ElasticSearch instance with the incorrect port number.
I'm new to NEST and ElasticSearch and trying to put together a a simple MatchAll query in NEST.
When I perform a MatchAll from Sense
POST /movies/movie/_search
{
"query": {
"match_all": {}
}
}
I get all the movie objects in the movies index.
But when I try the NEST query
var result = client.Search(s => s.Type("movie").MatchAll());
I get nothing back. Tried setting the return type to a movie class, and still no results.
public class Movie
{
public string title { get; set; }
public string director { get; set; }
public int year { get; set; }
public List<string> genres { get; set; }
}
Also tried .AllIndices() and/or .AllTypes() per this reply Searching an elasticsearch index with NEST yields no results
Any ideas?
EDIT: Heres the connection string setting the default index.
ConnectionSettings connection = new ConnectionSettings(uri).UsePrettyResponses().SetDefaultIndex("movies");