This commit is contained in:
crimean 2019-04-14 23:20:08 +03:00
parent c896b4714a
commit 2fb3484612

View file

@ -665,6 +665,7 @@ public class SearchCoreFactory {
categories = types.getCategories(false); categories = types.getCategories(false);
} }
List<AbstractPoiType> results = new ArrayList<AbstractPoiType>(); List<AbstractPoiType> results = new ArrayList<AbstractPoiType>();
List<AbstractPoiType> searchWordTypes = new ArrayList<AbstractPoiType>();
NameStringMatcher nm; NameStringMatcher nm;
String unknownSearchPhrase = phrase.getUnknownSearchPhrase(); String unknownSearchPhrase = phrase.getUnknownSearchPhrase();
if (phrase.getUnknownSearchWord().length() < unknownSearchPhrase.length()) { if (phrase.getUnknownSearchWord().length() < unknownSearchPhrase.length()) {
@ -678,6 +679,7 @@ public class SearchCoreFactory {
|| nm.matches(pf.getEnTranslation()) || nm.matches(pf.getEnTranslation())
|| nm.matches(pf.getSynonyms())) { || nm.matches(pf.getSynonyms())) {
results.add(pf); results.add(pf);
searchWordTypes.add(pf);
} }
} }
if (phrase.isUnknownSearchWordPresent()) { if (phrase.isUnknownSearchWordPresent()) {
@ -687,6 +689,7 @@ public class SearchCoreFactory {
|| nm.matches(c.getEnTranslation()) || nm.matches(c.getEnTranslation())
|| nm.matches(c.getSynonyms()))) { || nm.matches(c.getSynonyms()))) {
results.add(c); results.add(c);
searchWordTypes.add(c);
} }
} }
Iterator<Entry<String, PoiType>> it = translatedNames.entrySet().iterator(); Iterator<Entry<String, PoiType>> it = translatedNames.entrySet().iterator();
@ -699,6 +702,7 @@ public class SearchCoreFactory {
|| nm.matches(pt.getTranslation()) || nm.matches(pt.getTranslation())
|| nm.matches(pt.getSynonyms()))) { || nm.matches(pt.getSynonyms()))) {
results.add(pt); results.add(pt);
searchWordTypes.add(pt);
} }
List<PoiType> additionals = pt.getPoiAdditionals(); List<PoiType> additionals = pt.getPoiAdditionals();
if (additionals != null) { if (additionals != null) {
@ -715,7 +719,7 @@ public class SearchCoreFactory {
} }
} }
} }
phrase.setUnknownSearchWordPoiTypes(new ArrayList<>(results)); phrase.setUnknownSearchWordPoiTypes(searchWordTypes);
if (resultMatcher != null) { if (resultMatcher != null) {
String word = phrase.getUnknownSearchWord(); String word = phrase.getUnknownSearchWord();