From 93d212f7e5f5a77e6999c7ae672d73357cdd22af Mon Sep 17 00:00:00 2001 From: Andrew Lalis Date: Tue, 24 Jan 2023 22:21:51 +0100 Subject: [PATCH] Fixed index search case sensitivity, and index translation. --- gymboard-app/src/i18n/en-US/index.ts | 3 +++ gymboard-app/src/i18n/nl-NL/index.ts | 3 +++ gymboard-app/src/pages/IndexPage.vue | 6 +++--- .../andrewlalis/gymboardsearch/index/GymIndexSearcher.java | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/gymboard-app/src/i18n/en-US/index.ts b/gymboard-app/src/i18n/en-US/index.ts index 174a701..9126988 100644 --- a/gymboard-app/src/i18n/en-US/index.ts +++ b/gymboard-app/src/i18n/en-US/index.ts @@ -3,6 +3,9 @@ export default { language: 'Language', pages: 'Pages' }, + indexPage: { + searchHint: 'Search for a Gym' + }, gymPage: { home: 'Home', submit: 'Submit', diff --git a/gymboard-app/src/i18n/nl-NL/index.ts b/gymboard-app/src/i18n/nl-NL/index.ts index 0a09c65..b6dce4f 100644 --- a/gymboard-app/src/i18n/nl-NL/index.ts +++ b/gymboard-app/src/i18n/nl-NL/index.ts @@ -3,6 +3,9 @@ export default { language: 'Taal', pages: 'Pagina\'s' }, + indexPage: { + searchHint: 'Zoek een sportschool' + }, gymPage: { home: 'Thuis', submit: 'Indienen', diff --git a/gymboard-app/src/pages/IndexPage.vue b/gymboard-app/src/pages/IndexPage.vue index d54e529..ab01e02 100644 --- a/gymboard-app/src/pages/IndexPage.vue +++ b/gymboard-app/src/pages/IndexPage.vue @@ -2,7 +2,7 @@ import {onMounted, ref, Ref} from 'vue'; -import SimpleGymItem from 'components/SimpleGymItem.vue'; import {useRoute, useRouter} from 'vue-router'; -import StandardCenteredPage from 'components/StandardCenteredPage.vue'; import {GymSearchResult, searchGyms} from 'src/api/gymboard-search'; +import SimpleGymItem from 'src/components/SimpleGymItem.vue'; +import StandardCenteredPage from 'src/components/StandardCenteredPage.vue'; const route = useRoute(); const router = useRouter(); diff --git a/gymboard-search/src/main/java/nl/andrewlalis/gymboardsearch/index/GymIndexSearcher.java b/gymboard-search/src/main/java/nl/andrewlalis/gymboardsearch/index/GymIndexSearcher.java index 83b13cc..a0c2cb0 100644 --- a/gymboard-search/src/main/java/nl/andrewlalis/gymboardsearch/index/GymIndexSearcher.java +++ b/gymboard-search/src/main/java/nl/andrewlalis/gymboardsearch/index/GymIndexSearcher.java @@ -36,7 +36,7 @@ public class GymIndexSearcher { fieldWeights.put("country_name", 0.5f); fieldWeights.put("street_address", 0.1f); for (String term : terms) { - String searchTerm = term.strip() + "*"; + String searchTerm = term.strip().toLowerCase() + "*"; for (var entry : fieldWeights.entrySet()) { Query baseQuery = new WildcardQuery(new Term(entry.getKey(), searchTerm)); queryBuilder.add(new BoostQuery(baseQuery, entry.getValue()), BooleanClause.Occur.SHOULD);