Accessing the Repository
var elasticContext = new ElasticContext(LocalConfigurationManager.Elastic);
elasticContext.Connect();
string index = elasticContext.PrefixedIndexName("my_lookup_index");
Then you can issue searches against a source.
var response = elasticContext.Client.Search<IndexedFile>(s => s
.Index(index)
.From(0)
.Size(10)
.Query(q => q.Terms(c => c.Field("my_field").Terms(values)))
.SearchType(SearchType.DfsQueryThenFetch));{
"elastic": {
"server": [
"https://localhost:9200"
],
"username": "elastic",
"password": "changeme",
"prefix": "dev",
"enableTracing": false,
"certificate": {
"path": "C:\\elasticsearch-6.6.0\\config\\certs\\elastic-stack-ca.p12",
"password": "changeme"
}
}
}Last updated