Slowness in elastic search - optimization of query and score against individual values of the field

Dear All,

  1. We have documents in below format , the number of documents is more than 5 million.

{"_index":"Testinlive","_type":"_doc","_id":"vxYmiHgBWrQelERu5MPg","_score":1.0,"_source":{"GID":"433444","aLIASES":"Kishor,Askey Barrie;Kumar,Gaurav Joohn","aliasesList":["Kishor,Askey Barrie","Kumar,Gaurav Joohn"],"cATEGORY":"Financial CRIME","dOB":"1978/10/05","pLACEOFBIRTH":"","pASSPORTS":"","sSN":"","cOUNTRIES":"INDIA","eI":"M","kEYWORDS":"METPOL","keywordList":["METPOL"],"fullName":"Ashley kISHOR"}},]

  1. we are using below query , the problems quiet slow in order o search one name it takes some time 18 seconds. Pls let me know the solution for the same.

var searchResponse = _clientService.Search(s =>
s.Index("Testinlive")
.Take(model.SearchCount)
.From(0)
.TrackTotalHits(true)
//.MinScore(model.Score)
.TrackScores(true)
.Explain(true)
.Query(q =>
q.Bool(pp =>
pp.Must(qq =>
qq.Match(cc => cc.Field(ff => ff.KeywordList).Query(model.Keywords)) && (
qq.Match(x => x.Field(x0 => x0.FullName).Query(model.Name).Fuzziness(Fuzziness.Auto)) ||
qq.Match(p2 => p2.Field(fq2 => fq2.ALIASES.Replace(',', ' ').Replace(';', ' ').Replace('-', ' ')).Query(model.Name)) ||
qq.Match(p2 => p2.Field(fq2 => fq2.ALTERNATIVESPELLING.Replace(',', ' ').Replace(';', ' ')).Query(model.Name)) ||
qq.MatchPhrasePrefix(p2 => p2.Field(fq2 => fq2.COUNTRIES).Query(model.Country)) ||
qq.MatchPhrasePrefix(ma => ma.Field(fi => fi.DOB).Query(model.DOB)) ||
qq.MatchPhrasePrefix(p4 => p4.Field(fq4 => fq4.PLACEOFBIRTH).Query(model.CountryofBirth)) ||
qq.MatchPhrasePrefix(p5 => p5.Field(fq5 => fq5.PASSPORTS).Query(model.Id)))
)))
.Sort(sort => sort.Descending(SortSpecialField.Score))

  1. How to find the score of individual aliasesList values for the given name value.
    for example if i given Kishore Kumar name in what the score of matching for "Kishor,Askey Barrie" and "Kumar,Gaurav Joohn" So that whichever score is more we will show the same in the explanation.

  2. Note that we are using free version of Elasticsearch version 7.0.0. , Do we need to upgrade for better performance?please guide.

Kind Regards
Nisar

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