Fixed search (Hisar). Added test. Fixed wpt/favs search.

This commit is contained in:
max-klaus 2020-06-06 13:33:37 +03:00
parent f8bf673bc2
commit 63f6724859
4 changed files with 2148 additions and 4 deletions

View file

@ -843,6 +843,7 @@ public class CommonWords {
addCommon("van");
addCommon("road");
addCommon("street");
addCommon("sector");
addCommon("drive");
addCommon("avenue");
addCommon("rue");

View file

@ -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);

File diff suppressed because it is too large Load diff

View file

@ -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);