This commit is contained in:
Victor Shcherb 2020-07-04 00:53:37 +02:00
parent f1c7d7e276
commit aa56153a53

View file

@ -56,7 +56,7 @@ public class SearchResult {
public double getSumPhraseMatchWeight() { public double getSumPhraseMatchWeight() {
// if result is a complete match in the search we prioritize it higher // if result is a complete match in the search we prioritize it higher
boolean match = requiredSearchPhrase.countWords(localeName) <= getSelfWordCount(); boolean match = requiredSearchPhrase.countWords(localeName) <= getSelfWordCount();
double res = match ? ObjectType.getTypeWeight(objectType) : 0; double res = ObjectType.getTypeWeight(match ? objectType : null);
if (parentSearchResult != null) { if (parentSearchResult != null) {
res = res + parentSearchResult.getSumPhraseMatchWeight() / MAX_TYPE_WEIGHT; res = res + parentSearchResult.getSumPhraseMatchWeight() / MAX_TYPE_WEIGHT;
} }