From ff79bb518a908c6966b9988e59076adc2935714f Mon Sep 17 00:00:00 2001 From: PaulStets Date: Wed, 13 Sep 2017 13:43:25 +0300 Subject: [PATCH] Fied getRegionName for diffs and added grouping by regions for search --- OsmAnd-java/src/net/osmand/search/core/SearchPhrase.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OsmAnd-java/src/net/osmand/search/core/SearchPhrase.java b/OsmAnd-java/src/net/osmand/search/core/SearchPhrase.java index 40349a6d60..d788f6033b 100644 --- a/OsmAnd-java/src/net/osmand/search/core/SearchPhrase.java +++ b/OsmAnd-java/src/net/osmand/search/core/SearchPhrase.java @@ -535,9 +535,6 @@ public class SearchPhrase { if(indexes == null) { indexes = new ArrayList<>(getOfflineIndexes()); } - if (indexes.get(0).getFile().getName().matches("[a-zA-Z_-]+([0-9]+_*{3}).+[a-z]+")) { - return; - } final LatLon ll = getLastTokenLocation(); if(ll != null) { Collections.sort(indexes, new Comparator() { @@ -545,6 +542,9 @@ public class SearchPhrase { @Override public int compare(BinaryMapIndexReader o1, BinaryMapIndexReader o2) { + if (o1.getRegionName().equals(o2.getRegionName())) { + return o1.getFile().getName().compareTo(o2.getFile().getName()); + } LatLon rc1 = o1 == null ? null : getLocation(o1); LatLon rc2 = o2 == null ? null : getLocation(o2); double d1 = rc1 == null ? 10000000d : MapUtils.getDistance(rc1, ll);