Skip to main content

Function: useFacetedSearch()

useFacetedSearch(params): UseQueryResult<FacetedSearchResponse, Error>

Defined in: web/lib/hooks/use-faceted-search.ts:120

Performs faceted search with dynamic facets from the knowledge graph.

Parameters

params

UseFacetedSearchParams

Returns

UseQueryResult<FacetedSearchResponse, Error>

Remarks

Facets are fetched dynamically from nodes with subkind='facet'. Users can propose new facets through governance.

Example

const { data, isLoading } = useFacetedSearch({
facets: { methodology: ['meta-analysis'], 'time-period': ['21st-century'] },
limit: 20,
});

if (data) {
console.log(`Found ${data.total} results`);
console.log('Available facets:', data.facets);
}