diff --git a/search/src/components/FilterModal.tsx b/search/src/components/FilterModal.tsx index 7f51893636..29b95912d7 100644 --- a/search/src/components/FilterModal.tsx +++ b/search/src/components/FilterModal.tsx @@ -10,6 +10,8 @@ import { createMemo, } from "solid-js"; import { DatasetAndUserContext } from "./Contexts/DatasetAndUserContext"; +import { Tooltip } from "./Atoms/Tooltip"; +import { BsQuestionCircle } from "solid-icons/bs"; export interface Filter { field: string; @@ -39,6 +41,7 @@ export interface Filters { must: Filter[]; must_not: Filter[]; should: Filter[]; + jsonb_prefilter?: boolean | null; } export interface FilterModalProps { @@ -57,6 +60,7 @@ export const FilterModal = (props: FilterModalProps) => { const [mustFilters, setMustFilters] = createSignal([]); const [mustNotFilters, setMustNotFilters] = createSignal([]); const [shouldFilters, setShouldFilters] = createSignal([]); + const [jsonbPrefilter, setJsonbPrefilter] = createSignal(true); const curDatasetFiltersKey = createMemo( () => @@ -68,6 +72,7 @@ export const FilterModal = (props: FilterModalProps) => { must: mustFilters(), must_not: mustNotFilters(), should: shouldFilters(), + jsonb_prefilter: jsonbPrefilter(), }; localStorage.setItem(curDatasetFiltersKey(), JSON.stringify(filters)); window.dispatchEvent(new Event("filtersUpdated")); @@ -86,6 +91,7 @@ export const FilterModal = (props: FilterModalProps) => { setMustFilters(parsedFilters.must); setMustNotFilters(parsedFilters.must_not); setShouldFilters(parsedFilters.should); + setJsonbPrefilter(parsedFilters.jsonb_prefilter ?? true); } }, ""); @@ -137,6 +143,26 @@ export const FilterModal = (props: FilterModalProps) => { + Add Filter
+ + { + setJsonbPrefilter(e.currentTarget.checked); + }} + checked={jsonbPrefilter()} + />