From edd10cb092f1e928854e430f0e88395551d2086e Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sun, 24 May 2020 19:41:23 +0200 Subject: [PATCH] Fix #9061 --- .../src/main/java/net/osmand/search/core/ObjectType.java | 3 ++- .../src/main/java/net/osmand/search/core/SearchPhrase.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/search/core/ObjectType.java b/OsmAnd-java/src/main/java/net/osmand/search/core/ObjectType.java index 3236fa6032..9844f52646 100644 --- a/OsmAnd-java/src/main/java/net/osmand/search/core/ObjectType.java +++ b/OsmAnd-java/src/main/java/net/osmand/search/core/ObjectType.java @@ -52,8 +52,9 @@ public enum ObjectType { switch (t) { case HOUSE: case STREET_INTERSECTION: - return 3; + return 4; case STREET: + return 3; case POI: return 2; case CITY: diff --git a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchPhrase.java b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchPhrase.java index 41cc8b7929..8f6799e3be 100644 --- a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchPhrase.java +++ b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchPhrase.java @@ -121,7 +121,7 @@ public class SearchPhrase { int i1 = CommonWords.getCommonSearch(o1.toLowerCase()); int i2 = CommonWords.getCommonSearch(o2.toLowerCase()); if (i1 != i2) { - return icompare(i1, i2); + return -icompare(i1, i2); } // compare length without numbers to not include house numbers return -icompare(lengthWithoutNumbers(o1), lengthWithoutNumbers(o2));