I'm using .NET NEST for searching in Elasticsearch.
When I index a document and immediately search for it it is not found:
var node = new Uri("http://localhost:9200");
var settings = new ConnectionSettings(node);
settings.DefaultIndex("products_test");
settings.DisableDirectStreaming(true);
ElasticClient client = new ElasticClient(settings);
Product p = new Product("My Product", "6");
client.IndexDocument(p);
var results = client.Search<Product>(s => s.Query(q => q.MatchAll()));
results.HitsMetadata.Total //is 0 and results.Hits are empty
Why?
Do I have to commit somehow?
Thanks
EDIT: But when I run the Console App again and comment out the creation, the document IS found.