Fix search core

This commit is contained in:
Victor Shcherb 2017-04-17 20:07:56 +03:00
parent 4b2c3b0b1d
commit ef6918d828
2 changed files with 4 additions and 5 deletions

View file

@ -308,6 +308,7 @@ public class SearchCoreFactory {
if (phrase.isEmptyQueryAllowed() && phrase.isEmpty()) {
resultMatcher.publish(res);
} else if (nm.matches(res.localeName) || nm.matches(res.otherNames)) {
res.firstUnknownWordMatches = wrd.equals(phrase.getUnknownSearchWord());
subSearchApiOrPublish(phrase, resultMatcher, res, cityApi);
}
if (limit++ > LIMIT * phrase.getRadiusLevel()) {
@ -447,9 +448,7 @@ public class SearchCoreFactory {
}
r.searchAddressDataByName(req);
for (SearchResult res : immediateResults) {
res.firstUnknownWordMatches = wordToSearch.equals(phrase.getUnknownSearchWord()) ||
phrase.getNameStringMatcher().matches(res.localeName) ||
phrase.getNameStringMatcher().matches(res.otherNames);
res.firstUnknownWordMatches = wordToSearch.equals(phrase.getUnknownSearchWord());
if (res.objectType == ObjectType.STREET) {
City ct = ((Street) res.object).getCity();
phrase.countUnknownWordsMatch(res,

View file

@ -664,8 +664,8 @@ public class SearchPhrase {
@Override
public int compare(String o1, String o2) {
int i1 = CommonWords.getCommonSearch(o1);
int i2 = CommonWords.getCommonSearch(o2);
int i1 = CommonWords.getCommonSearch(o1.toLowerCase());
int i2 = CommonWords.getCommonSearch(o2.toLowerCase());
if (i1 != i2) {
return icompare(i1, i2);
}