diff --git a/tools/BankFinder/src/commonMain/kotlin/net/dankito/banking/bankfinder/InMemoryBankFinder.kt b/tools/BankFinder/src/commonMain/kotlin/net/dankito/banking/bankfinder/InMemoryBankFinder.kt index 04c47057..43701381 100644 --- a/tools/BankFinder/src/commonMain/kotlin/net/dankito/banking/bankfinder/InMemoryBankFinder.kt +++ b/tools/BankFinder/src/commonMain/kotlin/net/dankito/banking/bankfinder/InMemoryBankFinder.kt @@ -39,7 +39,7 @@ open class InMemoryBankFinder() : BankFinderBase(), IBankFinder { protected open fun checkIfQueryMatchesBankNameOrCity(bankInfo: BankInfo, queryLowerCase: String): Boolean { return bankInfo.name.toLowerCase().contains(queryLowerCase) - || bankInfo.city.toLowerCase().contains(queryLowerCase) + || bankInfo.city.toLowerCase().startsWith(queryLowerCase) } diff --git a/tools/LuceneBankFinder/src/main/kotlin/net/dankito/banking/bankfinder/LuceneBankFinder.kt b/tools/LuceneBankFinder/src/main/kotlin/net/dankito/banking/bankfinder/LuceneBankFinder.kt index 2737ac73..8f86b03e 100644 --- a/tools/LuceneBankFinder/src/main/kotlin/net/dankito/banking/bankfinder/LuceneBankFinder.kt +++ b/tools/LuceneBankFinder/src/main/kotlin/net/dankito/banking/bankfinder/LuceneBankFinder.kt @@ -93,7 +93,7 @@ open class LuceneBankFinder(indexFolder: File) : BankFinderBase(), IBankFinder { val luceneQuery = queries.createQueriesForSingleTerms(query.toLowerCase()) { singleTerm -> listOf( queries.fulltextQuery(BankInfoNameFieldName, singleTerm), - queries.contains(BankInfoCityIndexedFieldName, singleTerm) + queries.startsWith(BankInfoCityIndexedFieldName, singleTerm) ) }