|
39 | 39 | @update:model-value="updateTypesenseAdapterConfiguration()" |
40 | 40 | ></q-select> |
41 | 41 |
|
| 42 | + <div class="text-subtitle2 q-pt-md">Max Candidates</div> |
| 43 | + <q-input |
| 44 | + v-model.number="maxCandidates" |
| 45 | + type="number" |
| 46 | + outlined |
| 47 | + dense |
| 48 | + :min="0" |
| 49 | + :max="10000" |
| 50 | + hint="Number of similar words for prefix and typo searching" |
| 51 | + @update:model-value="updateTypesenseAdapterConfiguration()" |
| 52 | + ></q-input> |
| 53 | + |
42 | 54 | <div v-for="name in facetNumberFields" :key="name" class="q-mb-sm"> |
43 | 55 | <div class="text-subtitle2 q-pt-md">{{ name }}</div> |
44 | 56 | <ais-range-input :searchable="true" :attribute="name" /> |
@@ -89,6 +101,7 @@ const typesenseInstantsearchAdapter = ref<TypesenseInstantSearchAdapter>(); |
89 | 101 | const instantSearchInstance = ref<any>(); |
90 | 102 | const searchClientError = ref<string | null>(null); |
91 | 103 | const currentStopwordsSet = ref(null); |
| 104 | +const maxCandidates = ref(4); |
92 | 105 |
|
93 | 106 | const middlewares = [ |
94 | 107 | ({ instantSearchInstance: instance }: any) => { |
@@ -173,6 +186,7 @@ const updateTypesenseAdapterConfiguration = () => { |
173 | 186 | // @ts-expect-error internal property |
174 | 187 | ...typesenseInstantsearchAdapter.value.configuration.additionalSearchParameters, |
175 | 188 | stopwords: currentStopwordsSet.value, |
| 189 | + max_candidates: maxCandidates.value, |
176 | 190 | }, |
177 | 191 | }); |
178 | 192 | } |
@@ -202,7 +216,7 @@ watch( |
202 | 216 | apiKey: store.loginData.apiKey, |
203 | 217 | }, |
204 | 218 | additionalSearchParameters: { |
205 | | - exhaustive_search: true, |
| 219 | + max_candidates: maxCandidates.value, |
206 | 220 | query_by, |
207 | 221 | }, |
208 | 222 | }); |
|
0 commit comments