Skip to content

Commit e35dbc5

Browse files
authored
Merge pull request #106 from bfritscher/feat-maxcandidates
feat: Improve search for large collections
2 parents 043af04 + 08ad271 commit e35dbc5

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "typesense-dashboard",
3-
"version": "2.2.0",
3+
"version": "2.2.1",
44
"description": "A Typesense Dashboard to manage and browse collections.",
55
"productName": "Typesense-Dashboard",
66
"author": "Boris Fritscher <boris@fritscher.ch>",

src/components/search/SearchInstantSearch.vue

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@
3939
@update:model-value="updateTypesenseAdapterConfiguration()"
4040
></q-select>
4141

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+
4254
<div v-for="name in facetNumberFields" :key="name" class="q-mb-sm">
4355
<div class="text-subtitle2 q-pt-md">{{ name }}</div>
4456
<ais-range-input :searchable="true" :attribute="name" />
@@ -89,6 +101,7 @@ const typesenseInstantsearchAdapter = ref<TypesenseInstantSearchAdapter>();
89101
const instantSearchInstance = ref<any>();
90102
const searchClientError = ref<string | null>(null);
91103
const currentStopwordsSet = ref(null);
104+
const maxCandidates = ref(4);
92105
93106
const middlewares = [
94107
({ instantSearchInstance: instance }: any) => {
@@ -173,6 +186,7 @@ const updateTypesenseAdapterConfiguration = () => {
173186
// @ts-expect-error internal property
174187
...typesenseInstantsearchAdapter.value.configuration.additionalSearchParameters,
175188
stopwords: currentStopwordsSet.value,
189+
max_candidates: maxCandidates.value,
176190
},
177191
});
178192
}
@@ -202,7 +216,7 @@ watch(
202216
apiKey: store.loginData.apiKey,
203217
},
204218
additionalSearchParameters: {
205-
exhaustive_search: true,
219+
max_candidates: maxCandidates.value,
206220
query_by,
207221
},
208222
});

0 commit comments

Comments
 (0)