public void TestWithVeryElasticMapping(string url) { var jsonSettings = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore, MissingMemberHandling = MissingMemberHandling.Ignore, ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor , ContractResolver = new VeryElasticContractResolver() }; var connection = new ElasticConnectionImpl(new Uri(url), index: "current,currentforfind"); var context = new ElasticSession(connection, new VeryElasticMapping(jsonSettings)); var query = context.Query <Person>(); Assert.NotNull(query); var res = query.ToList(); Assert.NotEmpty(res); var q2 = context.Query <Person>("current").Where(person => person.Id > 3); var res2 = q2.ToList(); Assert.NotEmpty(res2); }
public string GetBodyExample(SearchRequest instance) { var settings = this.GetSettings(); var connection = new ElasticConnectionImpl(new Uri("http://localhost:9200"), index: "current,currentforfind"); var mapping = new VeryElasticMapping(settings); var formatter = new SearchRequestFormatter(connection, mapping, instance); return(formatter.Body); }
public void FirstTest(string url) { var connection = new ElasticConnectionImpl(new Uri(url), index: "current"); var context = new ElasticSession(connection, new ElasticMapping(pluralizeTypeNames: false)); var query = context.Query <Person>(); Assert.NotNull(query); var res = query.ToList(); Assert.NotEmpty(res); }