Skip to content

Commit

Permalink
feat: Refine by XBlock type too
Browse files Browse the repository at this point in the history
  • Loading branch information
bradenmacdonald committed Mar 5, 2024
1 parent 1482d34 commit 5e0bb24
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/header/SearchModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ interface Props {
const SearchModal: React.FC<Props> = ({courseId, ...props}) => {
const intl = useIntl();

// Load the Meilisearch connection details from the LMS: the URL to use, the index name, and an API key specific
// to us (to the current user) that allows us to search all content we have permission to view.
const {
data: searchEndpointData,
isLoading
Expand Down
10 changes: 7 additions & 3 deletions src/header/SearchUI.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React from 'react';
import {
InstantSearch,
InfiniteHits,
HierarchicalMenu,
Highlight,
InfiniteHits,
InstantSearch,
RefinementList,
SearchBox,
Stats,
Highlight
} from "react-instantsearch-dom";
import { useIntl } from '@edx/frontend-platform/i18n';
import { instantMeiliSearch } from "@meilisearch/instant-meilisearch";
Expand All @@ -28,6 +29,9 @@ const SearchUI: React.FC<Props> = (props) => {
<InstantSearch indexName={props.indexName} searchClient={searchClient}>
<Stats />
<SearchBox />
<strong>Refine by component type:</strong>
<RefinementList attribute="block_type" />
<strong>Refine by tag:</strong>
<HierarchicalMenu
attributes={[
"tags.taxonomy",
Expand Down

0 comments on commit 5e0bb24

Please sign in to comment.