Skip to content

Instantly share code, notes, and snippets.

View russcam's full-sized avatar
🤓
Always learning!

Russ Cam russcam

🤓
Always learning!
View GitHub Profile
{
"took": 55,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 2,
@russcam
russcam / Fields-with-NEST-5.0.1.cs
Created January 23, 2017 23:01
Working with Fields in NEST 5.0.1
void Main()
{
var pool = new SingleNodeConnectionPool(new Uri("http://localhost:9200"));
var connectionSettings = new ConnectionSettings(pool);
var client = new ElasticClient(connectionSettings);
/**
All the following produce the query json
@russcam
russcam / Cancellation-In-NEST-2.x.cs
Created December 28, 2016 23:17
Cancellation for async methods in NEST 2.x
void Main()
{
var client = new ElasticClient();
var cancellationTokenSource = new CancellationTokenSource();
client.Search<Document>(s => s
.Query(q => q
.MatchAll()
)
.RequestConfiguration(r => r