Fix search bank abcd
This commit is contained in:
parent
6ac823bb9c
commit
4c2cfb9c97
5 changed files with 17 additions and 3 deletions
|
@ -124,6 +124,9 @@ public class CollatorStringMatcher implements StringMatcher {
|
|||
public static boolean cstartsWith(Collator collator, String searchInParam, String theStart,
|
||||
boolean checkBeginning, boolean checkSpaces, boolean equals, boolean trim) {
|
||||
String searchIn = searchInParam.toLowerCase(Locale.getDefault());
|
||||
if (trim && searchIn.length() > 0) {
|
||||
searchIn += " ";
|
||||
}
|
||||
int searchInLength = searchIn.length();
|
||||
if (trim && searchInLength > 0 && theStart.length() > searchInLength) {
|
||||
theStart = theStart.substring(0, searchInLength);
|
||||
|
|
|
@ -500,7 +500,7 @@ public class SearchUICore {
|
|||
}
|
||||
currentSearchResult = collection;
|
||||
if (phrase.getSettings().isExportObjects()) {
|
||||
rm.createTestJSON(collection);
|
||||
//rm.createTestJSON(collection);
|
||||
}
|
||||
rm.searchFinished(phrase);
|
||||
if (onResultsComplete != null) {
|
||||
|
|
|
@ -662,8 +662,13 @@ public class SearchCoreFactory {
|
|||
categories = types.getCategories(false);
|
||||
}
|
||||
List<AbstractPoiType> results = new ArrayList<AbstractPoiType>();
|
||||
NameStringMatcher nm =
|
||||
new NameStringMatcher(phrase.getUnknownSearchPhrase(), StringMatcherMode.CHECK_STARTS_FROM_SPACE);
|
||||
NameStringMatcher nm;
|
||||
String unknownSearchPhrase = phrase.getUnknownSearchPhrase();
|
||||
if (phrase.getUnknownSearchWord().length() < unknownSearchPhrase.length()) {
|
||||
nm = new NameStringMatcher(unknownSearchPhrase, StringMatcherMode.CHECK_ONLY_STARTS_WITH_TRIM);
|
||||
} else {
|
||||
nm = new NameStringMatcher(unknownSearchPhrase, StringMatcherMode.CHECK_STARTS_FROM_SPACE);
|
||||
}
|
||||
for (AbstractPoiType pf : topVisibleFilters) {
|
||||
if (!phrase.isUnknownSearchWordPresent()
|
||||
|| nm.matches(pf.getTranslation())
|
||||
|
|
|
@ -9,6 +9,11 @@ public class SearchExportSettings {
|
|||
exportBuildings = true;
|
||||
}
|
||||
|
||||
public SearchExportSettings(boolean exportEmptyCities, boolean exportBuildings) {
|
||||
this.exportEmptyCities = exportEmptyCities;
|
||||
this.exportBuildings = exportBuildings;
|
||||
}
|
||||
|
||||
public boolean isExportEmptyCities() {
|
||||
return exportEmptyCities;
|
||||
}
|
||||
|
|
|
@ -24,6 +24,7 @@ public class SearchSettings {
|
|||
private boolean emptyQueryAllowed;
|
||||
private boolean sortByName;
|
||||
private SearchExportSettings exportSettings;
|
||||
//private SearchExportSettings exportSettings = new SearchExportSettings(false, false);
|
||||
|
||||
public SearchSettings(SearchSettings s) {
|
||||
if(s != null) {
|
||||
|
|
Loading…
Reference in a new issue