Fixed index search case sensitivity, and index translation.

This commit is contained in:
Andrew Lalis 2023-01-24 22:21:51 +01:00
parent 3ce2d99c22
commit 93d212f7e5
4 changed files with 10 additions and 4 deletions

View File

@ -3,6 +3,9 @@ export default {
language: 'Language',
pages: 'Pages'
},
indexPage: {
searchHint: 'Search for a Gym'
},
gymPage: {
home: 'Home',
submit: 'Submit',

View File

@ -3,6 +3,9 @@ export default {
language: 'Taal',
pages: 'Pagina\'s'
},
indexPage: {
searchHint: 'Zoek een sportschool'
},
gymPage: {
home: 'Thuis',
submit: 'Indienen',

View File

@ -2,7 +2,7 @@
<StandardCenteredPage>
<q-input
v-model="searchQuery"
label="Search for a Gym"
:label="$t('indexPage.searchHint')"
clearable
:loading="searchBarLoadingState"
@update:modelValue="onSearchQueryUpdated"
@ -20,10 +20,10 @@
<script setup lang="ts">
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();

View File

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