Reputation: 105
I have 7M documents my index. With NEST client i am searching "*" query with this code.
var node = new Uri("http://localhost:9200");
var settings = new ConnectionSettings(
node,
defaultIndex: "evaluation"
);
var client = new ElasticClient(settings);
var result = client.Search<FtsResult>(s => s
.From(0)
.Fields(new[] { "id" })
.Indices(indexName)
.Size(Int32.MaxValue)
.Query(q => q
.QueryString(qs => qs.OnFields(new[] { "agentText", "customerText" }).Query("*"))
)
And result elapsedtime is 59.6 sec. In Kibana same query result elapsedtime is just about 4 sec. Why Nest search query is too slow according to Kibana ?
Upvotes: 1
Views: 562
Reputation: 52368
Because you do this:
.Size(Int32.MaxValue)
I'm surprised your nodes don't run out of memory with this Size
. Use a smaller size or, if you really want all documents, use scan&scroll.
Upvotes: 4