Fix filter poi by name

This commit is contained in:
Victor Shcherb 2016-07-24 11:30:12 +02:00
parent 282287e821
commit b7378c0c61

View file

@ -556,10 +556,6 @@ public class SearchCoreFactory {
SearchResult res = new SearchResult(phrase); SearchResult res = new SearchResult(phrase);
res.localeName = object.getName(phrase.getSettings().getLang(), true); res.localeName = object.getName(phrase.getSettings().getLang(), true);
res.otherNames = object.getAllNames(true); res.otherNames = object.getAllNames(true);
if (!Algorithms.isEmpty(phrase.getLastWord())
&& !(ns.matches(res.localeName) || ns.matches(res.otherNames))) {
return false;
}
if (Algorithms.isEmpty(res.localeName)) { if (Algorithms.isEmpty(res.localeName)) {
AbstractPoiType st = types.getAnyPoiTypeByKey(object.getSubType()); AbstractPoiType st = types.getAnyPoiTypeByKey(object.getSubType());
if (st != null) { if (st != null) {
@ -568,6 +564,11 @@ public class SearchCoreFactory {
res.localeName = object.getSubType(); res.localeName = object.getSubType();
} }
} }
if (!Algorithms.isEmpty(phrase.getLastWord())
&& !(ns.matches(res.localeName) || ns.matches(res.otherNames))) {
return false;
}
res.object = object; res.object = object;
res.preferredZoom = 17; res.preferredZoom = 17;
res.file = selected[0]; res.file = selected[0];