Skip to content
Snippets Groups Projects
Commit cecb26a8 authored by Remi  PLANEL's avatar Remi PLANEL
Browse files

activate numerical filters

parent 6f9d97c6
No related branches found
No related tags found
2 merge requests!203Foldseek pages,!186Refactor facet autocomplete
Pipeline #120034 passed with warnings
This commit is part of merge request !186. Comments created here will be created in the context of that merge request.
...@@ -7,7 +7,6 @@ import { useThrottleFn } from '@vueuse/core' ...@@ -7,7 +7,6 @@ import { useThrottleFn } from '@vueuse/core'
import type { FacetInputItem } from '@/components/AutocompleteMeiliFacets.vue' import type { FacetInputItem } from '@/components/AutocompleteMeiliFacets.vue'
import { useMeiliSearch } from "#imports" import { useMeiliSearch } from "#imports"
// import { saveAs } from "file-saver"; // import { saveAs } from "file-saver";
import { useFileSystemAccess } from '@vueuse/core'
export interface SortItem { export interface SortItem {
key: string, key: string,
order: boolean | 'asc' | 'desc' order: boolean | 'asc' | 'desc'
...@@ -151,9 +150,9 @@ const msFilter = computed(() => { ...@@ -151,9 +150,9 @@ const msFilter = computed(() => {
} else { return null } } else { return null }
}) })
const computedFilter = computed(() => { const computedFilter = computed(() => {
console.log(toValue(msFilter)) console.log(toValue(msFilterCompo))
if (msFilter.value !== null) { if (msFilterCompo.value !== null) {
return [toValue(msFilter), props.numericalFilters].filter(f => f !== undefined && f !== null).join(" AND ") return [toValue(msFilterCompo), props.numericalFilters].filter(f => f !== undefined && f !== null).join(" AND ")
} }
}) })
...@@ -187,7 +186,7 @@ async function searchOrFilter() { ...@@ -187,7 +186,7 @@ async function searchOrFilter() {
loading.value = true loading.value = true
// const q = queryInputValue.value === null ? "" : queryInputValue.value // const q = queryInputValue.value === null ? "" : queryInputValue.value
const q = search.value const q = search.value
await msSearch(q, { ...paginationParams.value, filter: toValue(msFilterCompo), sort: msSortBy.value }) await msSearch(q, { ...paginationParams.value, filter: toValue(computedFilter), sort: msSortBy.value })
} catch (error: any) { } catch (error: any) {
filterError.value = error filterError.value = error
console.log(error) console.log(error)
...@@ -203,7 +202,7 @@ function emitRefreshRes() { ...@@ -203,7 +202,7 @@ function emitRefreshRes() {
emit("refresh:search", { emit("refresh:search", {
index: props.db, index: props.db,
query: q, query: q,
params: { ...notPaginatedParams.value, filter: toValue(msFilterCompo), sort: msSortBy.value } params: { ...notPaginatedParams.value, filter: toValue(computedFilter), sort: msSortBy.value }
}) })
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment