Bidzina Goginashvili

Bidzina Goginashvili

  • NA
  • 206
  • 26.6k

My ElastiSearch query in .net is fetching data too slow.help

Jul 29 2019 3:41 AM
I don't know why response needs too much time to query data.
 
var response = _client.Search<ModelName>(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? 

Answers (1)

0
Afzaal Ahmad Zeeshan

Afzaal Ahmad Zeeshan

  • 31
  • 39.2k
  • 5.8m
Jul 29 2019 1:33 PM
There is no way that we can check the response time of your query; can you provide the details for that? 

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