I don't know why response needs too much time to query data.
var response = _client.Search(s => s
.Index("products")
.From(0)
.Size(10)
.Query(q => q
.MultiMatch(m => m
.Fields(fields => fields
.Field(
p => p.ManufacturerPartNumber
)
.Field(
p => p.Name,5
)
.Field(
p => p.FullDescription
)
.Field(
p => p.ShortDescription
)
.Field(
p => p.Sku
))
.Query(term)
.Type(TextQueryType.BestFields))));
var productIds = (from hits in response.Hits
select hits.Source.Id).ToArray();
var models = _productModelFactory.PrepareElasticProductOverviewModels(productIds, false, true, _mediaSettings.AutoCompleteSearchThumbPictureSize).ToList();
in kibana in took it writes 264
GET /products/_search
{
"query": { "match_all": {}},
"size":10000
}
pls any suggestions?
Afzaal Ahmad ZeeshanPosted Jul 29, 2019, 1:33 PM
What we can suggest is that you keep the search size small (check your query), secondly try checking the logs to verify what actually is causing the problems in this. Profiling the .NET code might also help. Read this guide of theirs to undersatnd how this can be improved, https://www.elastic.co/blog/advanced-tuning-finding-and-fixing-slow-elasticsearch-queries