From b7378c0c6198aceb00f10ae9b6160ab1b5f6ce9c Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sun, 24 Jul 2016 11:30:12 +0200 Subject: [PATCH] Fix filter poi by name --- .../src/net/osmand/search/core/SearchCoreFactory.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/OsmAnd-java/src/net/osmand/search/core/SearchCoreFactory.java b/OsmAnd-java/src/net/osmand/search/core/SearchCoreFactory.java index ad096ee4be..f4dedd9c48 100644 --- a/OsmAnd-java/src/net/osmand/search/core/SearchCoreFactory.java +++ b/OsmAnd-java/src/net/osmand/search/core/SearchCoreFactory.java @@ -556,10 +556,6 @@ public class SearchCoreFactory { SearchResult res = new SearchResult(phrase); res.localeName = object.getName(phrase.getSettings().getLang(), 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)) { AbstractPoiType st = types.getAnyPoiTypeByKey(object.getSubType()); if (st != null) { @@ -568,6 +564,11 @@ public class SearchCoreFactory { res.localeName = object.getSubType(); } } + if (!Algorithms.isEmpty(phrase.getLastWord()) + && !(ns.matches(res.localeName) || ns.matches(res.otherNames))) { + return false; + } + res.object = object; res.preferredZoom = 17; res.file = selected[0];