@@ -160,15 +160,15 @@ Nonetheless you might want to still showcase them even if they have 0 matched do
160160
161161Without ` keepZeroFacets ` set to ` true ` :
162162genres:
163- - [x] horror (2000)
164- - [x] thriller (214)
165- - [ ] comedy (0)
163+ - [x] horror (2000)
164+ - [x] thriller (214)
165+ - [ ] comedy (0)
166166
167167With ` keepZeroFacets ` set to ` false ` , ` comedy ` disapears:
168168
169169genres:
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'
683683injectScript (
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
709709For 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```
730730Without providing this parameter, Google Maps will default to a window containing all markers from the provided search results.
731731
732732Alternatively, 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:
806806Give 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
817817You 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
956956instantsearch .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
10631063The 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
0 commit comments