Which is faster GetAsync or SearchAsync in elastic search NEST?

 var response = elasticClient
                    .SearchAsync<item>(a => a
                        .Index("item")
                        .AllTypes()
                        .Size(1)
                        .Query(q => q
                            .Match(p => p.Field("Id").Query(id.ToString()))));
                var responseTook = response.Result.Took;

OR

var response1 = elasticClient.GetAsync<item>(id);

Get by id is faster and real time.
Search is not real time. Your document might not be found even if you just indexed it.

2 Likes

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.