Skip to content

Commit

Permalink
Minor improvement to search
Browse files Browse the repository at this point in the history
  • Loading branch information
jayvarner committed Oct 3, 2024
1 parent 2c6c699 commit f4f16b2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions app/components/search/FacetMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ClearRefinements, RefinementList } from "react-instantsearch";
import { modelFieldUUIDs } from "~/config";
import type { RefinementListClassNames } from "node_modules/react-instantsearch/dist/es/ui/RefinementList";

const RefinementListClassNames: Partial<RefinementListClassNames> = {
const refinementListClassNames: Partial<RefinementListClassNames> = {
checkbox:
"me-2 group size-3 rounded border bg-white data-[checked]:bg-blue-500",
count:
Expand Down Expand Up @@ -41,7 +41,7 @@ const FacetMenu = () => {
<MenuSection className="mb-4 pb-4 border-b-2">
<RefinementList
attribute={`${modelFieldUUIDs.types}.name_facet`}
classNames={RefinementListClassNames}
classNames={refinementListClassNames}
sortBy={["count:desc"]}
showMore
showMoreLimit={200}
Expand All @@ -51,7 +51,7 @@ const FacetMenu = () => {
<MenuSection>
<RefinementList
attribute={`${modelFieldUUIDs.county}.names_facet`}
classNames={RefinementListClassNames}
classNames={refinementListClassNames}
sortBy={["name:asc"]}
operator="and"
/>
Expand Down
1 change: 1 addition & 0 deletions app/routes/search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ type SearchProps = {
};

const Search = ({ serverState, serverUrl }: SearchProps) => {
console.log("🚀 ~ Search ~ serverState:", serverState);
const [map, setMap] = useState<TMap | undefined>(undefined);
const [mapLoaded, setMapLoaded] = useState<boolean>(false);

Expand Down
7 changes: 3 additions & 4 deletions app/utils/typesense-adapter.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// FIXME: This is a known issue: https://github.com/typesense/typesense-instantsearch-adapter/issues/199
import TypesenseInstantSearchAdapterExport from "typesense-instantsearch-adapter";
import { keys } from "~/config";
import { keys, modelFieldUUIDs } from "~/config";

export const TypesenseInstantSearchAdapter =
// @ts-ignore
Expand All @@ -25,10 +25,9 @@ export const typesenseInstantSearchAdapter = new TypesenseInstantSearchAdapter({
// So you can pass any parameters supported by the search endpoint below.
// query_by is required.
additionalSearchParameters: {
query_by: "name,names",
query_by: "*",
collection: "gca",
facet_by: "*",
max_facet_values: 20,
facet_by: `${modelFieldUUIDs.county}.names_facet,${modelFieldUUIDs.types}.name_facet`,
per_page: 25,
},
});
Expand Down

0 comments on commit f4f16b2

Please sign in to comment.