6
6
SearchBox ,
7
7
useInstantSearch
8
8
} from "react-instantsearch"
9
- import { currentGeneralCourt } from "functions/src/shared"
9
+ import { currentLegislativeSession } from "functions/src/shared"
10
10
import styled from "styled-components"
11
11
import TypesenseInstantSearchAdapter from "typesense-instantsearch-adapter"
12
12
import { Col , Row } from "../../bootstrap"
@@ -16,7 +16,7 @@ import { SearchContainer } from "../SearchContainer"
16
16
import { SearchErrorBoundary } from "../SearchErrorBoundary"
17
17
import { useRouting } from "../useRouting"
18
18
import { BillHit } from "./BillHit"
19
- import { useBillRefinements , useCourtRefinements } from "./useBillRefinements"
19
+ import { useBillRefinements , useSessionRefinements } from "./useBillRefinements"
20
20
import { useBillHierarchicalMenu } from "./useBillHierarchicalMenu"
21
21
import { SortBy , SortByWithConfigurationItem } from "../SortBy"
22
22
import { getServerConfig } from "../common"
@@ -66,7 +66,14 @@ export const BillSearch = () => {
66
66
indexName = { initialSortByValue }
67
67
initialUiState = { {
68
68
[ initialSortByValue ] : {
69
- refinementList : { court : [ String ( currentGeneralCourt ) ] }
69
+ refinementList : { court : [ String ( currentLegislativeSession ) ] }
70
+ // `court:` should be `session:` but 404 - Could not find a facet field named `session` in the schema.
71
+ //
72
+ // needs adjusting? :
73
+ // node_modules\typesense-instantsearch-adapter\lib\TypesenseInstantsearchAdapter.js
74
+ //
75
+ // see also useBillRefinements.tsx:
76
+ // attribute: "court",
70
77
}
71
78
} }
72
79
searchClient = { searchClient }
@@ -101,28 +108,27 @@ const useSearchStatus = () => {
101
108
const Layout : FC <
102
109
React . PropsWithChildren < { items : SortByWithConfigurationItem [ ] } >
103
110
> = ( { items } ) => {
104
- const courtRefinements = useCourtRefinements ( )
111
+ const sessionRefinements = useSessionRefinements ( )
105
112
const refinements = useBillRefinements ( )
106
113
const hierarchicalMenu = useBillHierarchicalMenu ( )
107
114
const status = useSearchStatus ( )
108
115
109
- console . log ( "Refinement Options" , refinements . options )
110
-
111
116
return (
112
117
< SearchContainer >
113
118
< Row >
114
119
< SearchBox placeholder = "Search For Bills" className = "mt-2 mb-3" />
115
120
</ Row >
116
121
< Row >
117
122
< Col xs = { 3 } lg = { 3 } >
118
- { courtRefinements . options }
123
+ { sessionRefinements . options }
119
124
{ hierarchicalMenu . options }
120
125
{ refinements . options }
121
126
</ Col >
122
127
< Col className = "d-flex flex-column" >
123
128
< RefinementRow >
124
129
< ResultCount className = "flex-grow-1 m-1" />
125
130
< SortBy items = { items } />
131
+ { sessionRefinements . show }
126
132
{ hierarchicalMenu . show }
127
133
{ refinements . show }
128
134
</ RefinementRow >
0 commit comments