Fix search with brand
This commit is contained in:
parent
b0b8bec02f
commit
c006e7897b
4 changed files with 15 additions and 2 deletions
|
@ -549,7 +549,8 @@ public class BinaryMapPoiReaderAdapter {
|
|||
if (!matches) {
|
||||
Map<String, String> lt = am.getAdditionalInfo();
|
||||
for (Entry<String, String> e : lt.entrySet()) {
|
||||
if(!e.getKey().contains("_name")) {
|
||||
if(!e.getKey().contains("_name") &&
|
||||
!e.getKey().equals("brand")) {
|
||||
continue;
|
||||
}
|
||||
matches = matcher.matches(e.getValue());
|
||||
|
|
|
@ -59,6 +59,9 @@ public class EntityParser {
|
|||
if (mo.getName().length() == 0) {
|
||||
setNameFromRef(mo, tags);
|
||||
}
|
||||
if (mo.getName().length() == 0) {
|
||||
setNameFromBrand(mo, tags);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -119,6 +122,13 @@ public class EntityParser {
|
|||
mo.setName(ref);
|
||||
}
|
||||
}
|
||||
|
||||
private static void setNameFromBrand(MapObject mo, Map<String, String> tags) {
|
||||
String ref = tags.get(OSMTagKey.BRAND.getValue());
|
||||
if(ref != null){
|
||||
mo.setName(ref);
|
||||
}
|
||||
}
|
||||
|
||||
private static void setNameFromOperator(MapObject mo, Map<String, String> tags) {
|
||||
String op = tags.get(OSMTagKey.OPERATOR.getValue());
|
||||
|
|
|
@ -24,6 +24,7 @@ public class OSMSettings {
|
|||
// transport
|
||||
ROUTE("route"), //$NON-NLS-1$
|
||||
ROUTE_MASTER("route_master"), //$NON-NLS-1$
|
||||
BRAND("brand"), //$NON-NLS-1$
|
||||
OPERATOR("operator"), //$NON-NLS-1$
|
||||
REF("ref"), //$NON-NLS-1$
|
||||
RCN_REF("rcn_ref"), //$NON-NLS-1$
|
||||
|
|
|
@ -525,7 +525,8 @@ public class SearchCoreFactory {
|
|||
sr.otherNames = object.getAllNames(true);
|
||||
sr.localeName = object.getName(phrase.getSettings().getLang(), phrase.getSettings().isTransliterate());
|
||||
if (phrase.isUnknownSearchWordComplete()) {
|
||||
if(!nm.matches(sr.localeName) && !nm.matches(sr.otherNames)) {
|
||||
if(!nm.matches(sr.localeName) && !nm.matches(sr.otherNames) &&
|
||||
!nm.matches(object.getAdditionalInfo().values())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue