SOLVED : URI가 잘못되었습니다. "h || p : //#.#.#.#/ : 9200"이었고 "h || p : //#.#.#.: : 9200"이어야합니다. 이로 인해 API가 포트 번호를 80으로 변경했습니다. API가 실제로 잘못된 포트 번호로 ElasticSearch 인스턴스에 연결할 수 있다는 사실에 놀랐습니다.ElasticSearch 및 NEST 쿼리 문제
저는 NEST와 ElasticSearch를 처음 접했고 NEST에서 간단한 MatchAll 쿼리를 작성하려고합니다.
나는 감각POST /movies/movie/_search
{
"query": {
"match_all": {}
}
}
나는 영화 지수의 모든 영화 개체를 얻을에서 MatchAll을 수행 할 때. 나는 NEST 쿼리를 할 때
는 그러나
var result = client.Search(s => s.Type("movie").MatchAll());
나는 다시 아무 것도 얻을 수 없습니다. 반환 형식을 무비 클래스로 설정하려고 시도했지만 여전히 결과가 없습니다.
public class Movie
{
public string title { get; set; }
public string director { get; set; }
public int year { get; set; }
public List<string> genres { get; set; }
}
또한 시도 .AllIndices() 및/또는이 응답 Searching an elasticsearch index with NEST yields no results
어떤 아이디어 당 .AllTypes()?
EDIT : Heres는 연결 문자열을 기본 색인으로 설정합니다.
ConnectionSettings connection = new ConnectionSettings(uri).UsePrettyResponses().SetDefaultIndex("movies");
답장 Martijn에게 감사드립니다. IsValid() 메서드가 실제로 IQueryResponse 개체에 있고 문서 상태와 같은 ElasticClient가 아니라는 것을 덧붙입니다. http://nest.azurewebsites.net/concepts/connecting.html – user19055