Skip to content

Commit ada210e

Browse files
committed
restore indentation
1 parent 73c6c22 commit ada210e

File tree

3 files changed

+70
-70
lines changed

3 files changed

+70
-70
lines changed

packages/instant-meilisearch/README.md

Lines changed: 61 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -160,15 +160,15 @@ Nonetheless you might want to still showcase them even if they have 0 matched do
160160

161161
Without `keepZeroFacets` set to `true`:
162162
genres:
163-
- [x] horror (2000)
164-
- [x] thriller (214)
165-
- [ ] comedy (0)
163+
- [x] horror (2000)
164+
- [x] thriller (214)
165+
- [ ] comedy (0)
166166

167167
With `keepZeroFacets` set to `false`, `comedy` disapears:
168168

169169
genres:
170-
- [x] horror (2000)
171-
- [x] thriller (214)
170+
- [x] horror (2000)
171+
- [x] thriller (214)
172172

173173
```js
174174
{ keepZeroFacets : true } // default: false
@@ -282,20 +282,20 @@ In `index.html`:
282282
```html
283283
<!DOCTYPE html>
284284
<html lang="en">
285-
<head>
286-
<meta charset="utf-8" />
287-
</head>
288-
289-
<body>
290-
<div>
291-
<div id="searchbox"></div>
292-
<div id="hits"></div>
293-
</div>
294-
295-
<script src="https://cdn.jsdelivr.net/npm/@meilisearch/instant-meilisearch/dist/instant-meilisearch.umd.min.js"></script>
296-
<script src="https://cdn.jsdelivr.net/npm/instantsearch.js@4"></script>
297-
<script src="./app.js"></script>
298-
</body>
285+
<head>
286+
<meta charset="utf-8" />
287+
</head>
288+
289+
<body>
290+
<div>
291+
<div id="searchbox"></div>
292+
<div id="hits"></div>
293+
</div>
294+
295+
<script src="https://cdn.jsdelivr.net/npm/@meilisearch/instant-meilisearch/dist/instant-meilisearch.umd.min.js"></script>
296+
<script src="https://cdn.jsdelivr.net/npm/instantsearch.js@4"></script>
297+
<script src="./app.js"></script>
298+
</body>
299299
</html>
300300
```
301301

@@ -683,11 +683,11 @@ import injectScript from 'scriptjs'
683683
injectScript(
684684
`https://maps.googleapis.com/maps/api/js?v=quarterly&key=${GOOGLE_API}`,
685685
() => {
686-
const search = instantsearch({
686+
const search = instantsearch({
687687
indexName: 'geo',
688688
// ...
689-
})
690-
// ...
689+
})
690+
// ...
691691
})
692692
```
693693

@@ -701,9 +701,9 @@ The classic usage, with only the `required` elements, renders an embedded Google
701701

702702
```js
703703
instantsearch.widgets.geoSearch({
704-
container: '#maps',
705-
googleReference: window.google,
706-
}),
704+
container: '#maps',
705+
googleReference: window.google,
706+
}),
707707
```
708708

709709
For further customization, for example to determine an initial position for the map. Contrary to `initialZoom` and `initialPosition`, triggers a search request with the provided information.
@@ -719,24 +719,24 @@ For exemple, by adding `boundingBox` in the [`instantSearch`](#-instantsearch) w
719719

720720
```js
721721
initialUiState: {
722-
geo: {
723-
geoSearch: {
724-
boundingBox:
725-
'50.680720183653065, 3.273798366642514,50.55969330590075, 2.9625244444490253',
722+
geo: {
723+
geoSearch: {
724+
boundingBox:
725+
'50.680720183653065, 3.273798366642514,50.55969330590075, 2.9625244444490253',
726+
},
726727
},
727728
},
728-
},
729729
```
730730
Without providing this parameter, Google Maps will default to a window containing all markers from the provided search results.
731731

732732
Alternatively, the parameters can be passed through the [`searchFunction`](https://www.algolia.com/doc/api-reference/widgets/instantsearch/js/#widget-param-searchfunction) parameter of the [`instantSearch`](#-instantsearch) widget. Contrary to `initialUiState` these parameters overwrite the values on each search.
733733

734734
```js
735735
searchFunction: function (helper) {
736-
helper.setQueryParameter('aroundRadius', 75000)
737-
helper.setQueryParameter('aroundLatLng', '51.1241999, 9.662499900000057');
738-
helper.search()
739-
},
736+
helper.setQueryParameter('aroundRadius', 75000)
737+
helper.setQueryParameter('aroundLatLng', '51.1241999, 9.662499900000057');
738+
helper.search()
739+
},
740740
```
741741

742742
[Read the guide on how GeoSearch works in Meilisearch](https://www.meilisearch.com/docs/learn/getting_started/filtering_and_sorting#geosearch).
@@ -806,12 +806,12 @@ Example:
806806
Give the following document structure:
807807
```json
808808
{
809-
"id": 1,
810-
"name": "Basic T-shirt",
811-
"categories.lvl0": "Men",
812-
"categories.lvl1": "Men > clothes",
813-
"categories.lvl2": "Men > clothes > t-shirt"
814-
}
809+
"id": 1,
810+
"name": "Basic T-shirt",
811+
"categories.lvl0": "Men",
812+
"categories.lvl1": "Men > clothes",
813+
"categories.lvl2": "Men > clothes > t-shirt"
814+
}
815815
```
816816

817817
You have to add the fields `categories.lvl0`, `categories.lvl1` and `categories.lvl2` in the `filterableAttributes` in your Meilisearch settings.
@@ -954,8 +954,8 @@ The `clearRefinement` widget displays a button that lets the user clean every re
954954

955955
```js
956956
instantsearch.widgets.clearRefinements({
957-
container: '#clear-refinements',
958-
}),
957+
container: '#clear-refinements',
958+
}),
959959
```
960960

961961
### ✅ Pagination
@@ -1061,8 +1061,8 @@ The usage of the `SortBy` widget differs from the one found in Algolia's documen
10611061
- Different `sort` rules on the same index.
10621062

10631063
The items list is composed of objects containing every sort possibility you want to provide to your user. Each object must contain two fields:
1064-
- `label`: What is showcased on the user interface ex: `Sort by Ascending Price`
1065-
- `value`: The sort formula.
1064+
- `label`: What is showcased on the user interface ex: `Sort by Ascending Price`
1065+
- `value`: The sort formula.
10661066

10671067
#### Sort formula
10681068

@@ -1091,23 +1091,23 @@ See [relevancy guide](https://www.meilisearch.com/docs/learn/core_concepts/relev
10911091

10921092
```js
10931093
instantsearch.widgets.sortBy({
1094-
container: '#sort-by',
1095-
items: [
1096-
{ value: 'clothes', label: 'Relevant' }, // default index
1097-
{
1098-
value: 'clothes:price:desc', // Sort on descending price
1099-
label: 'Ascending price using query time sort',
1100-
},
1101-
{
1102-
value: 'clothes:price:asc', // Sort on ascending price
1103-
label: 'Descending price using query time sort',
1104-
},
1105-
{
1106-
value: 'clothes-sorted', // different index with different ranking rules.
1107-
label: 'Custom sort using a different index',
1108-
},
1109-
],
1110-
}),
1094+
container: '#sort-by',
1095+
items: [
1096+
{ value: 'clothes', label: 'Relevant' }, // default index
1097+
{
1098+
value: 'clothes:price:desc', // Sort on descending price
1099+
label: 'Ascending price using query time sort',
1100+
},
1101+
{
1102+
value: 'clothes:price:asc', // Sort on ascending price
1103+
label: 'Descending price using query time sort',
1104+
},
1105+
{
1106+
value: 'clothes-sorted', // different index with different ranking rules.
1107+
label: 'Custom sort using a different index',
1108+
},
1109+
],
1110+
}),
11111111
```
11121112

11131113
### ❌ RelevantSort

packages/instant-meilisearch/src/adapter/search-request-adapter/search-params-adapter.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export function MeiliParamsCreator(searchContext: SearchContext) {
139139
addAttributesToHighlight() {
140140
meiliSearchParams.attributesToHighlight =
141141
overrideParams?.attributesToHighlight ??
142-
<Mutable<typeof attributesToHighlight>>attributesToHighlight ?? ['*']
142+
<Mutable<typeof attributesToHighlight>>attributesToHighlight ?? ['*']
143143
},
144144
addPreTag() {
145145
meiliSearchParams.highlightPreTag =
@@ -226,8 +226,8 @@ export function MeiliParamsCreator(searchContext: SearchContext) {
226226
overrideParams?.attributesToSearchOn !== undefined
227227
? overrideParams.attributesToSearchOn
228228
: <Mutable<typeof restrictSearchableAttributes>>(
229-
restrictSearchableAttributes
230-
)
229+
restrictSearchableAttributes
230+
)
231231
if (value !== undefined) {
232232
meiliSearchParams.attributesToSearchOn = value
233233
}

packages/instant-meilisearch/src/types/types.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,15 @@ export type InstantSearchPagination = {
105105

106106
export type MeilisearchMultiSearchResult<T = Record<string, any>> =
107107
MultiSearchResult<T> & {
108-
pagination: PaginationState
109-
}
108+
pagination: PaginationState
109+
}
110110

111111
export type SearchContext = InstantMeiliSearchOptions &
112112
InstantSearchParams & {
113-
pagination: PaginationState
114-
indexUid: string
115-
sort?: string | string[]
116-
}
113+
pagination: PaginationState
114+
indexUid: string
115+
sort?: string | string[]
116+
}
117117

118118
export type InstantSearchGeoParams = {
119119
aroundLatLng?: string

0 commit comments

Comments
 (0)