diff --git a/src/common/constants/complexLookup.constants.ts b/src/common/constants/complexLookup.constants.ts index 61ad1388..e977f220 100644 --- a/src/common/constants/complexLookup.constants.ts +++ b/src/common/constants/complexLookup.constants.ts @@ -16,6 +16,12 @@ export enum SearchableIndex { Genre = 'genre', } +export enum SearchableIndexQuerySelector { + Query = 'query', + Prev = 'prev', + Next = 'next', +} + export const COMPLEX_LOOKUPS_LINKED_FIELDS_MAPPING = { subclass: { PERSON: { diff --git a/src/common/helpers/search/formatters/index.ts b/src/common/helpers/search/formatters/index.ts index bf89d013..085324a1 100644 --- a/src/common/helpers/search/formatters/index.ts +++ b/src/common/helpers/search/formatters/index.ts @@ -4,5 +4,6 @@ export const SEARCH_RESULTS_FORMATTER: Record< string, (data: any, sourceData?: SourceDataDTO) => SearchResultsTableRow[] > = { + default: formatAuthorityItem, authorities: formatAuthorityItem, }; diff --git a/src/common/helpers/search/queryBuilder/authorities.ts b/src/common/helpers/search/queryBuilder/authorities.ts new file mode 100644 index 00000000..33ebb74f --- /dev/null +++ b/src/common/helpers/search/queryBuilder/authorities.ts @@ -0,0 +1,15 @@ +import { SearchableIndexQuerySelector } from '@common/constants/complexLookup.constants'; +import { SEARCH_QUERY_VALUE_PARAM } from '@common/constants/search.constants'; + +export const buildSearchQuery = ({ + map, + selector = SearchableIndexQuerySelector.Query, + searchBy, + value, +}: BuildSearchQueryParams) => { + const searchableIndex = map?.[searchBy]; + + return searchableIndex?.[selector]?.replaceAll(SEARCH_QUERY_VALUE_PARAM, value); +}; + +export const buildBrowseQuery = () => {}; diff --git a/src/common/helpers/search/queryBuilder/index.ts b/src/common/helpers/search/queryBuilder/index.ts index 57535977..d291fa62 100644 --- a/src/common/helpers/search/queryBuilder/index.ts +++ b/src/common/helpers/search/queryBuilder/index.ts @@ -1 +1,9 @@ -export { buildSearchQuery } from './queryBuilder'; +import { buildSearchQuery } from './authorities'; + +export const SEARCH_QUERY_BUILDER: Record< + string, + ({ map, selector, searchBy, value }: BuildSearchQueryParams) => string | undefined +> = { + default: buildSearchQuery, + authorities: buildSearchQuery, +}; diff --git a/src/common/helpers/search/queryBuilder/queryBuilder.ts b/src/common/helpers/search/queryBuilder/queryBuilder.ts deleted file mode 100644 index 84bf6eb9..00000000 --- a/src/common/helpers/search/queryBuilder/queryBuilder.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { SEARCH_QUERY_VALUE_PARAM } from '@common/constants/search.constants'; - -export const buildSearchQuery = (map: SearchableIndexEntries, searchBy: SearchableIndexType, value: string) => { - const searchableIndex = map?.[searchBy]; - - return searchableIndex?.query?.replaceAll(SEARCH_QUERY_VALUE_PARAM, value); -}; diff --git a/src/common/hooks/useLoadSearchResults.ts b/src/common/hooks/useLoadSearchResults.ts index 3ccac802..947f2664 100644 --- a/src/common/hooks/useLoadSearchResults.ts +++ b/src/common/hooks/useLoadSearchResults.ts @@ -67,13 +67,8 @@ export const useLoadSearchResults = (fetchData: ({ query, searchBy, offset }: Fe async function onLoad() { setIsLoading(true); - if (getSearchSourceData) { - await getSearchSourceData(); - } - - if (getSearchFacetsData) { - await getSearchFacetsData(); - } + await getSearchSourceData?.(); + await getSearchFacetsData?.(); if (defaultSearchBy && defaultQuery) { await fetchData({ query: defaultQuery as string, searchBy: defaultSearchBy, offset: 0 }); diff --git a/src/common/hooks/useSearch.ts b/src/common/hooks/useSearch.ts index 72963561..3afb833a 100644 --- a/src/common/hooks/useSearch.ts +++ b/src/common/hooks/useSearch.ts @@ -7,11 +7,11 @@ import { SearchIdentifiers } from '@common/constants/search.constants'; import { StatusType } from '@common/constants/status.constants'; import { generateSearchParamsState, normalizeQuery } from '@common/helpers/search.helper'; import { normalizeLccn } from '@common/helpers/validations.helper'; -import { buildSearchQuery } from '@common/helpers/search/queryBuilder'; import { UserNotificationFactory } from '@common/services/userNotification'; import { usePagination } from '@common/hooks/usePagination'; import state from '@state'; import { useSearchContext } from './useSearchContext'; +import { SearchableIndexQuerySelector } from '@common/constants/complexLookup.constants'; export const useSearch = () => { const { @@ -30,6 +30,7 @@ export const useSearch = () => { searchByControlOptions, searchableIndicesMap, getSearchSourceData, + buildSearchQuery, } = useSearchContext(); const setIsLoading = useSetRecoilState(state.loadingState.isLoading); const [searchBy, setSearchBy] = useRecoilState(state.search.index); @@ -94,7 +95,13 @@ export const useSearch = () => { ); const fetchData = useCallback( - async ({ query, searchBy, offset, selectedSegment }: FetchDataParams) => { + async ({ + query, + searchBy, + offset, + selectedSegment, + baseQuerySelector = SearchableIndexQuerySelector.Query, + }: FetchDataParams) => { setMessage(''); const selectedNavigationSegment = selectedSegment ?? navigationSegment?.value; @@ -114,13 +121,15 @@ export const useSearch = () => { isVisibleSegments && selectedNavigationSegment ? searchableIndicesMap?.[selectedNavigationSegment as SearchSegmentValue] : searchableIndicesMap; - const generatedQuery = fetchSearchResults - ? (buildSearchQuery( - selectedSearchableIndices as SearchableIndexEntries, - searchBy as unknown as SearchableIndexType, - updatedQuery, - ) as string) - : (updatedQuery as string); + const generatedQuery = + fetchSearchResults && buildSearchQuery + ? (buildSearchQuery({ + map: selectedSearchableIndices as SearchableIndexEntries, + selector: baseQuerySelector, + searchBy: searchBy as unknown as SearchableIndexType, + value: updatedQuery, + }) as string) + : (updatedQuery as string); const result = fetchSearchResults ? await fetchSearchResults({ diff --git a/src/components/ComplexLookupField/ModalComplexLookup.tsx b/src/components/ComplexLookupField/ModalComplexLookup.tsx index c772c3bb..67576496 100644 --- a/src/components/ComplexLookupField/ModalComplexLookup.tsx +++ b/src/components/ComplexLookupField/ModalComplexLookup.tsx @@ -18,6 +18,7 @@ import { ComplexLookupSearchResults } from './ComplexLookupSearchResults'; import { MarсPreviewComplexLookup } from './MarсPreviewComplexLookup'; import { SEARCH_RESULTS_TABLE_CONFIG } from './configs'; import './ModalComplexLookup.scss'; +import { SEARCH_QUERY_BUILDER } from '@common/helpers/search/queryBuilder'; interface ModalComplexLookupProps { isOpen: boolean; @@ -47,6 +48,7 @@ export const ModalComplexLookup: FC = memo( } = COMPLEX_LOOKUPS_CONFIG[assignEntityName]; const tableConfig = SEARCH_RESULTS_TABLE_CONFIG[assignEntityName] || SEARCH_RESULTS_TABLE_CONFIG.default; const searchResultsFormatter = SEARCH_RESULTS_FORMATTER[assignEntityName] || SEARCH_RESULTS_FORMATTER.default; + const buildSearchQuery = SEARCH_QUERY_BUILDER[assignEntityName] || SEARCH_QUERY_BUILDER.default; const setIsMarcPreviewOpen = useSetRecoilState(state.ui.isMarcPreviewOpen); const setSearchQuery = useSetRecoilState(state.search.query); @@ -166,6 +168,7 @@ export const ModalComplexLookup: FC = memo( getSearchSourceData={getSourceData} getSearchFacetsData={getFacetsData} fetchSearchResults={getSearchResults} + buildSearchQuery={buildSearchQuery} searchResultsLimit={api.searchQuery.limit} searchResultsContainer={api.results.containers} onAssignRecord={onAssign} diff --git a/src/configs/complexLookup/complexLookupSeachableIndicesMap.ts b/src/configs/complexLookup/complexLookupSeachableIndicesMap.ts index 709eed7e..cb15805b 100644 --- a/src/configs/complexLookup/complexLookupSeachableIndicesMap.ts +++ b/src/configs/complexLookup/complexLookupSeachableIndicesMap.ts @@ -1,64 +1,77 @@ -import { SearchableIndex } from '@common/constants/complexLookup.constants'; +import { SearchableIndex, SearchableIndexQuerySelector } from '@common/constants/complexLookup.constants'; import { SEARCH_QUERY_VALUE_PARAM, SearchSegment } from '@common/constants/search.constants'; export const COMPLEX_LOOKUP_SEARCHABLE_INDICES_MAP: SearchableIndicesMap = { [SearchSegment.Search]: { [SearchableIndex.Keyword]: { - query: `(keyword=="${SEARCH_QUERY_VALUE_PARAM}" or naturalId="${SEARCH_QUERY_VALUE_PARAM}")`, + [SearchableIndexQuerySelector.Query]: `(keyword=="${SEARCH_QUERY_VALUE_PARAM}" or naturalId="${SEARCH_QUERY_VALUE_PARAM}")`, }, [SearchableIndex.Identifier]: { - query: `((identifiers.value=="${SEARCH_QUERY_VALUE_PARAM}" or naturalId="${SEARCH_QUERY_VALUE_PARAM}") and authRefType=="Authorized")`, + [SearchableIndexQuerySelector.Query]: `((identifiers.value=="${SEARCH_QUERY_VALUE_PARAM}" or naturalId="${SEARCH_QUERY_VALUE_PARAM}") and authRefType=="Authorized")`, }, [SearchableIndex.LCCN]: { - query: `lccn=="${SEARCH_QUERY_VALUE_PARAM}"`, + [SearchableIndexQuerySelector.Query]: `lccn=="${SEARCH_QUERY_VALUE_PARAM}"`, }, [SearchableIndex.PersonalName]: { - query: `(personalName all "${SEARCH_QUERY_VALUE_PARAM}" or sftPersonalName all "${SEARCH_QUERY_VALUE_PARAM}" or saftPersonalName all "${SEARCH_QUERY_VALUE_PARAM}")`, + [SearchableIndexQuerySelector.Query]: `(personalName all "${SEARCH_QUERY_VALUE_PARAM}" or sftPersonalName all "${SEARCH_QUERY_VALUE_PARAM}" or saftPersonalName all "${SEARCH_QUERY_VALUE_PARAM}")`, }, [SearchableIndex.CorporateConferenceName]: { - query: `(corporateName all "${SEARCH_QUERY_VALUE_PARAM}" or sftCorporateName all "${SEARCH_QUERY_VALUE_PARAM}" or saftCorporateName all "${SEARCH_QUERY_VALUE_PARAM}" or meetingName all "${SEARCH_QUERY_VALUE_PARAM}" or sftMeetingName all "${SEARCH_QUERY_VALUE_PARAM}" or saftMeetingName all "${SEARCH_QUERY_VALUE_PARAM}")`, + [SearchableIndexQuerySelector.Query]: `(corporateName all "${SEARCH_QUERY_VALUE_PARAM}" or sftCorporateName all "${SEARCH_QUERY_VALUE_PARAM}" or saftCorporateName all "${SEARCH_QUERY_VALUE_PARAM}" or meetingName all "${SEARCH_QUERY_VALUE_PARAM}" or sftMeetingName all "${SEARCH_QUERY_VALUE_PARAM}" or saftMeetingName all "${SEARCH_QUERY_VALUE_PARAM}")`, }, [SearchableIndex.GeographicName]: { - query: `(geographicName all "${SEARCH_QUERY_VALUE_PARAM}" or sftGeographicName all "${SEARCH_QUERY_VALUE_PARAM}" or saftGeographicName all "${SEARCH_QUERY_VALUE_PARAM}")`, + [SearchableIndexQuerySelector.Query]: `(geographicName all "${SEARCH_QUERY_VALUE_PARAM}" or sftGeographicName all "${SEARCH_QUERY_VALUE_PARAM}" or saftGeographicName all "${SEARCH_QUERY_VALUE_PARAM}")`, }, [SearchableIndex.NameTitle]: { - query: `(personalNameTitle all "${SEARCH_QUERY_VALUE_PARAM}" or sftPersonalNameTitle all "${SEARCH_QUERY_VALUE_PARAM}" or saftPersonalNameTitle all "${SEARCH_QUERY_VALUE_PARAM}" or corporateNameTitle all "${SEARCH_QUERY_VALUE_PARAM}" or sftCorporateNameTitle all "${SEARCH_QUERY_VALUE_PARAM}" or saftCorporateNameTitle all "${SEARCH_QUERY_VALUE_PARAM}" or meetingNameTitle all "${SEARCH_QUERY_VALUE_PARAM}" or sftMeetingNameTitle all "${SEARCH_QUERY_VALUE_PARAM}" or saftMeetingNameTitle all "${SEARCH_QUERY_VALUE_PARAM}")`, + [SearchableIndexQuerySelector.Query]: `(personalNameTitle all "${SEARCH_QUERY_VALUE_PARAM}" or sftPersonalNameTitle all "${SEARCH_QUERY_VALUE_PARAM}" or saftPersonalNameTitle all "${SEARCH_QUERY_VALUE_PARAM}" or corporateNameTitle all "${SEARCH_QUERY_VALUE_PARAM}" or sftCorporateNameTitle all "${SEARCH_QUERY_VALUE_PARAM}" or saftCorporateNameTitle all "${SEARCH_QUERY_VALUE_PARAM}" or meetingNameTitle all "${SEARCH_QUERY_VALUE_PARAM}" or sftMeetingNameTitle all "${SEARCH_QUERY_VALUE_PARAM}" or saftMeetingNameTitle all "${SEARCH_QUERY_VALUE_PARAM}")`, }, [SearchableIndex.UniformTitle]: { - query: `(uniformTitle all "${SEARCH_QUERY_VALUE_PARAM}" or sftUniformTitle all "${SEARCH_QUERY_VALUE_PARAM}" or saftUniformTitle all "${SEARCH_QUERY_VALUE_PARAM}")`, + [SearchableIndexQuerySelector.Query]: `(uniformTitle all "${SEARCH_QUERY_VALUE_PARAM}" or sftUniformTitle all "${SEARCH_QUERY_VALUE_PARAM}" or saftUniformTitle all "${SEARCH_QUERY_VALUE_PARAM}")`, }, [SearchableIndex.Subject]: { - query: `(topicalTerm all "${SEARCH_QUERY_VALUE_PARAM}" or sftTopicalTerm all "${SEARCH_QUERY_VALUE_PARAM}" or saftTopicalTerm all "${SEARCH_QUERY_VALUE_PARAM}")`, + [SearchableIndexQuerySelector.Query]: `(topicalTerm all "${SEARCH_QUERY_VALUE_PARAM}" or sftTopicalTerm all "${SEARCH_QUERY_VALUE_PARAM}" or saftTopicalTerm all "${SEARCH_QUERY_VALUE_PARAM}")`, }, [SearchableIndex.ChildrenSubjectHeading]: { - query: `((keyword all "${SEARCH_QUERY_VALUE_PARAM}" or naturalId="${SEARCH_QUERY_VALUE_PARAM}") and subjectHeadings=="b")`, + [SearchableIndexQuerySelector.Query]: `((keyword all "${SEARCH_QUERY_VALUE_PARAM}" or naturalId="${SEARCH_QUERY_VALUE_PARAM}") and subjectHeadings=="b")`, }, [SearchableIndex.Genre]: { - query: `(genreTerm all "${SEARCH_QUERY_VALUE_PARAM}" or sftGenreTerm all "${SEARCH_QUERY_VALUE_PARAM}" or saftGenreTerm all "${SEARCH_QUERY_VALUE_PARAM}")`, + [SearchableIndexQuerySelector.Query]: `(genreTerm all "${SEARCH_QUERY_VALUE_PARAM}" or sftGenreTerm all "${SEARCH_QUERY_VALUE_PARAM}" or saftGenreTerm all "${SEARCH_QUERY_VALUE_PARAM}")`, }, }, - // TODO: dynamically generate browse queries [SearchSegment.Browse]: { [SearchableIndex.PersonalName]: { - query: `(headingRef>="${SEARCH_QUERY_VALUE_PARAM}" or headingRef<"${SEARCH_QUERY_VALUE_PARAM}") and isTitleHeadingRef==false and headingType==("Personal Name")`, + [SearchableIndexQuerySelector.Query]: `(headingRef>="${SEARCH_QUERY_VALUE_PARAM}" or headingRef<"${SEARCH_QUERY_VALUE_PARAM}") and isTitleHeadingRef==false and headingType==("Personal Name")`, + [SearchableIndexQuerySelector.Prev]: `headingRef<"${SEARCH_QUERY_VALUE_PARAM}" and isTitleHeadingRef==false and headingType==("Personal Name")`, + [SearchableIndexQuerySelector.Next]: `headingRef>"${SEARCH_QUERY_VALUE_PARAM}" and isTitleHeadingRef==false and headingType==("Personal Name")`, }, [SearchableIndex.CorporateConferenceName]: { - query: `(headingRef>="${SEARCH_QUERY_VALUE_PARAM}" or headingRef<"${SEARCH_QUERY_VALUE_PARAM}") and isTitleHeadingRef==false and headingType==("Conference Name" or "Corporate Name")`, + [SearchableIndexQuerySelector.Query]: `(headingRef>="${SEARCH_QUERY_VALUE_PARAM}" or headingRef<"${SEARCH_QUERY_VALUE_PARAM}") and isTitleHeadingRef==false and headingType==("Conference Name" or "Corporate Name")`, + [SearchableIndexQuerySelector.Prev]: `headingRef<"${SEARCH_QUERY_VALUE_PARAM}" and isTitleHeadingRef==false and headingType==("Conference Name" or "Corporate Name")`, + [SearchableIndexQuerySelector.Next]: `headingRef>"${SEARCH_QUERY_VALUE_PARAM}" and isTitleHeadingRef==false and headingType==("Conference Name" or "Corporate Name")`, }, [SearchableIndex.GeographicName]: { - query: `(headingRef>="${SEARCH_QUERY_VALUE_PARAM}" or headingRef<"${SEARCH_QUERY_VALUE_PARAM}") and isTitleHeadingRef==false and headingType==("Geographic Name")`, + [SearchableIndexQuerySelector.Query]: `(headingRef>="${SEARCH_QUERY_VALUE_PARAM}" or headingRef<"${SEARCH_QUERY_VALUE_PARAM}") and isTitleHeadingRef==false and headingType==("Geographic Name")`, + [SearchableIndexQuerySelector.Prev]: `headingRef<"${SEARCH_QUERY_VALUE_PARAM}" and isTitleHeadingRef==false and headingType==("Geographic Name")`, + [SearchableIndexQuerySelector.Next]: `headingRef>"${SEARCH_QUERY_VALUE_PARAM}" and isTitleHeadingRef==false and headingType==("Geographic Name")`, }, [SearchableIndex.NameTitle]: { - query: `(headingRef>="${SEARCH_QUERY_VALUE_PARAM}" or headingRef<"${SEARCH_QUERY_VALUE_PARAM}") and isTitleHeadingRef==true and headingType==("Conference Name" or "Corporate Name" or "Personal Name")`, + [SearchableIndexQuerySelector.Query]: `(headingRef>="${SEARCH_QUERY_VALUE_PARAM}" or headingRef<"${SEARCH_QUERY_VALUE_PARAM}") and isTitleHeadingRef==true and headingType==("Conference Name" or "Corporate Name" or "Personal Name")`, + [SearchableIndexQuerySelector.Prev]: `headingRef<"${SEARCH_QUERY_VALUE_PARAM}" and isTitleHeadingRef==true and headingType==("Conference Name" or "Corporate Name" or "Personal Name")`, + [SearchableIndexQuerySelector.Next]: `headingRef>"${SEARCH_QUERY_VALUE_PARAM}" and isTitleHeadingRef==true and headingType==("Conference Name" or "Corporate Name" or "Personal Name")`, }, [SearchableIndex.UniformTitle]: { - query: `(headingRef>="${SEARCH_QUERY_VALUE_PARAM}" or headingRef<"${SEARCH_QUERY_VALUE_PARAM}") and isTitleHeadingRef==false and headingType==("Uniform Title")`, + [SearchableIndexQuerySelector.Query]: `(headingRef>="${SEARCH_QUERY_VALUE_PARAM}" or headingRef<"${SEARCH_QUERY_VALUE_PARAM}") and isTitleHeadingRef==false and headingType==("Uniform Title")`, + [SearchableIndexQuerySelector.Prev]: `headingRef<"${SEARCH_QUERY_VALUE_PARAM}" and isTitleHeadingRef==false and headingType==("Uniform Title")`, + [SearchableIndexQuerySelector.Next]: `headingRef>"${SEARCH_QUERY_VALUE_PARAM}" and isTitleHeadingRef==false and headingType==("Uniform Title")`, }, [SearchableIndex.Subject]: { - query: `(headingRef>="${SEARCH_QUERY_VALUE_PARAM}" or headingRef<"${SEARCH_QUERY_VALUE_PARAM}") and isTitleHeadingRef==false and headingType==("Topical")`, + [SearchableIndexQuerySelector.Query]: `(headingRef>="${SEARCH_QUERY_VALUE_PARAM}" or headingRef<"${SEARCH_QUERY_VALUE_PARAM}") and isTitleHeadingRef==false and headingType==("Topical")`, + [SearchableIndexQuerySelector.Prev]: `headingRef<"${SEARCH_QUERY_VALUE_PARAM}" and isTitleHeadingRef==false and headingType==("Topical")`, + [SearchableIndexQuerySelector.Next]: `headingRef>"${SEARCH_QUERY_VALUE_PARAM}" and isTitleHeadingRef==false and headingType==("Topical")`, }, [SearchableIndex.Genre]: { - query: `(headingRef>="${SEARCH_QUERY_VALUE_PARAM}" or headingRef<"${SEARCH_QUERY_VALUE_PARAM}") and isTitleHeadingRef==false and headingType==("Genre")`, + [SearchableIndexQuerySelector.Query]: `(headingRef>="${SEARCH_QUERY_VALUE_PARAM}" or headingRef<"${SEARCH_QUERY_VALUE_PARAM}") and isTitleHeadingRef==false and headingType==("Genre")`, + [SearchableIndexQuerySelector.Prev]: `headingRef<"${SEARCH_QUERY_VALUE_PARAM}" and isTitleHeadingRef==false and headingType==("Genre")`, + [SearchableIndexQuerySelector.Next]: `headingRef>"${SEARCH_QUERY_VALUE_PARAM}" and isTitleHeadingRef==false and headingType==("Genre")`, }, }, }; diff --git a/src/types/complexLookup.d.ts b/src/types/complexLookup.d.ts index aa8e0865..da74af5b 100644 --- a/src/types/complexLookup.d.ts +++ b/src/types/complexLookup.d.ts @@ -1,4 +1,6 @@ type SearchableIndexType = import('@common/constants/complexLookup.constants').SearchableIndex; +type SearchableIndexQuerySelectorType = + import('@common/constants/complexLookup.constants').SearchableIndexQuerySelector; type ComplexLookupLabels = { button: { @@ -50,10 +52,12 @@ type ComplexLookupApiEntryConfig = { }; }; +type SearchableIndexEntry = { + [key in SearchableIndexQuerySelectorType]?: string; +}; + type SearchableIndexEntries = { - [key in SearchableIndexType]?: { - query: string; - }; + [key in SearchableIndexType]?: SearchableIndexEntry; }; type SearchableIndicesMap = { @@ -83,3 +87,10 @@ type ComplexLookupAssignRecordDTO = { title: string; linkedFieldValue?: string; }; + +type BuildSearchQueryParams = { + map: SearchableIndexEntries; + selector?: SearchableIndexQuerySelectorType; + searchBy: SearchableIndexType; + value: string; +} diff --git a/src/types/search.d.ts b/src/types/search.d.ts index 7312f9a3..5333a165 100644 --- a/src/types/search.d.ts +++ b/src/types/search.d.ts @@ -42,6 +42,7 @@ type SearchParams = { getSearchFacetsData?: (facet?: string, isOpen?: boolean) => Promise; searchResultsLimit?: number; fetchSearchResults?: (params: any) => Promise; + buildSearchQuery?: (params: BuildSearchQueryParams) => string | undefined; searchResultsContainer?: { [key in SearchSegment]: string; }; @@ -100,4 +101,5 @@ type FetchDataParams = { searchBy: SearchIdentifiers; offset?: number; selectedSegment?: string; + baseQuerySelector?: SearchableIndexQuerySelectorType; };