Fixed search (Hisar). Added test. Fixed wpt/favs search.
This commit is contained in:
parent
f8bf673bc2
commit
63f6724859
4 changed files with 2148 additions and 4 deletions
|
@ -843,6 +843,7 @@ public class CommonWords {
|
|||
addCommon("van");
|
||||
addCommon("road");
|
||||
addCommon("street");
|
||||
addCommon("sector");
|
||||
addCommon("drive");
|
||||
addCommon("avenue");
|
||||
addCommon("rue");
|
||||
|
|
|
@ -226,7 +226,7 @@ public class SearchCoreFactory {
|
|||
sr.objectType = ObjectType.REGION;
|
||||
sr.location = bmir.getRegionCenter();
|
||||
sr.preferredZoom = 6;
|
||||
if (phrase.getFirstUnknownSearchWord().length() <= 1 && phrase.isNoSelectedType()) {
|
||||
if (phrase.getFullSearchPhrase().length() <= 1 && phrase.isNoSelectedType()) {
|
||||
resultMatcher.publish(sr);
|
||||
} else if (phrase.getFirstUnknownNameStringMatcher().matches(sr.localeName)) {
|
||||
resultMatcher.publish(sr);
|
||||
|
|
2143
OsmAnd-java/src/test/resources/search/hisar.json
Normal file
2143
OsmAnd-java/src/test/resources/search/hisar.json
Normal file
File diff suppressed because it is too large
Load diff
|
@ -204,7 +204,7 @@ public class QuickSearchHelper implements ResourceListener {
|
|||
//sr.localeRelatedObjectName = app.getRegions().getCountryName(sr.location);
|
||||
sr.relatedObject = selectedGpx.getGpxFile();
|
||||
sr.preferredZoom = 17;
|
||||
if (phrase.getFirstUnknownSearchWord().length() <= 1 && phrase.isNoSelectedType()) {
|
||||
if (phrase.getFullSearchPhrase().length() <= 1 && phrase.isNoSelectedType()) {
|
||||
resultMatcher.publish(sr);
|
||||
} else if (phrase.getFirstUnknownNameStringMatcher().matches(sr.localeName)) {
|
||||
resultMatcher.publish(sr);
|
||||
|
@ -316,7 +316,7 @@ public class QuickSearchHelper implements ResourceListener {
|
|||
continue;
|
||||
}
|
||||
}
|
||||
if (phrase.getFirstUnknownSearchWord().length() <= 1
|
||||
if (phrase.getFullSearchPhrase().length() <= 1
|
||||
&& (phrase.isNoSelectedType() || phrase.isLastWord(ObjectType.FAVORITE_GROUP))) {
|
||||
resultMatcher.publish(sr);
|
||||
} else if (phrase.getFirstUnknownNameStringMatcher().matches(sr.localeName)) {
|
||||
|
@ -460,7 +460,7 @@ public class QuickSearchHelper implements ResourceListener {
|
|||
}
|
||||
if (publish) {
|
||||
sr.priority = SEARCH_HISTORY_OBJECT_PRIORITY + (p++);
|
||||
if (phrase.getFirstUnknownSearchWord().length() <= 1 && phrase.isNoSelectedType()) {
|
||||
if (phrase.getFullSearchPhrase().length() <= 1 && phrase.isNoSelectedType()) {
|
||||
resultMatcher.publish(sr);
|
||||
} else if (phrase.getFirstUnknownNameStringMatcher().matches(sr.localeName)) {
|
||||
resultMatcher.publish(sr);
|
||||
|
|
Loading…
Reference in a new issue