Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hacky Prototype search UI using Instantsearch + Meilisearch [FC-0040] #868

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: Refine by XBlock type too
  • Loading branch information
bradenmacdonald committed Mar 21, 2024
commit ed28225261ee97d1184f0c8cacbb69de8b225865
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