You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`placeholderSearch` (`true` by default). Displays documents even when the query is empty.
97
+
### Placeholder Search
98
+
99
+
Placeholders search means showing results even when the search query is empty. By default it is `true`.
100
+
When placeholder search is set to `false`, no results appears when searching on no characters. For example, if the query is "" no results appear.
101
+
102
+
```js
103
+
{ placeholderSearch :true } // default true
104
+
```
105
+
106
+
### Pagination total hits
107
+
108
+
The total (and finite) number of hits you can browse during pagination when using the [pagination widget](https://www.algolia.com/doc/api-reference/widgets/pagination/js/). If the pagination widget is not used, `paginationTotalHits` is ignored.<br>
109
+
110
+
Which means that, with a `paginationTotalHits` default value of 200, and `hitsPerPage` default value of 20, you can browse `paginationTotalHits / hitsPerPage` => `200 / 20 = 10` pages during pagination. Each of the 10 pages containing 20 results.<br>
111
+
112
+
The default value of `hitsPerPage` is set to `20` but it can be changed with [`InsantSearch.configure`](https://www.algolia.com/doc/api-reference/widgets/configure/js/#examples).<br>
113
+
114
+
```js
115
+
{ paginationTotalHits :20 } // default: 200
116
+
```
117
+
118
+
⚠️ Meilisearch is not designed for pagination and this can lead to performances issues, so the usage of the pagination widget is not encouraged. However, the `paginationTotalHits` parameter lets you implement this pagination with less performance issue as possible: depending on your dataset (the size of each document and the number of documents) you might decrease the value of `paginationTotalHits`.<br>
119
+
More information about Meilisearch and the pagination [here](https://github.com/meilisearch/documentation/issues/561).
120
+
121
+
### Primary key
122
+
123
+
Specify the field in your documents containing the [unique identifier](https://docs.meilisearch.com/learn/core_concepts/documents.html#primary-field) (`undefined` by default). By adding this option, we avoid instantSearch errors that are thrown in the browser console. In `React` particularly, this option removes the `Each child in a list should have a unique "key" prop` error.
124
+
125
+
```js
126
+
{ primaryKey :'id' } // default: undefined
127
+
```
128
+
129
+
### keepZeroFacets
93
130
94
-
-`paginationTotalHits` (`200` by default): The total (and finite) number of hits you can browse during pagination when using the [pagination widget](https://www.algolia.com/doc/api-reference/widgets/pagination/js/). If the pagination widget is not used, `paginationTotalHits` is ignored.<br>
95
-
Which means that, with a `paginationTotalHits` default value of 200, and `hitsPerPage` default value of 20, you can browse `paginationTotalHits / hitsPerPage` => `200 / 20 = 10` pages during pagination. Each of the 10 pages containing 20 results.<br>
96
-
The default value of `hitsPerPage` is set to `20` but it can be changed with [`InsantSearch.configure`](https://www.algolia.com/doc/api-reference/widgets/configure/js/#examples).<br>
97
-
⚠️ Meilisearch is not designed for pagination and this can lead to performances issues, so the usage of the pagination widget is not encouraged. However, the `paginationTotalHits` parameter lets you implement this pagination with less performance issue as possible: depending on your dataset (the size of each document and the number of documents) you might decrease the value of `paginationTotalHits`.<br>
98
-
More information about Meilisearch and the pagination [here](https://github.com/meilisearch/documentation/issues/561).
99
-
-`primaryKey` (`undefined` by default): Specify the field in your documents containing the [unique identifier](https://docs.meilisearch.com/learn/core_concepts/documents.html#primary-field). By adding this option, we avoid instantSearch errors that are thrown in the browser console. In `React` particularly, this option removes the `Each child in a list should have a unique "key" prop` error.
131
+
`keepZeroFacets` set to `true` keeps the facets even when they have 0 matching documents (default `false`).
132
+
133
+
When using `refinementList` it happens that by checking some facets, the ones with no more valid documents disapear.
134
+
Nonetheless you might want to still showcase them even if they have 0 matched documents with the current request:
135
+
136
+
Without `keepZeroFacets` set to `true`:
137
+
genres:
138
+
-[x] horror (2000)
139
+
-[x] thriller (214)
140
+
-[ ] comedy (0)
141
+
142
+
With `keepZeroFacets` set to `false`, `comedy` disapears:
143
+
144
+
genres:
145
+
-[x] horror (2000)
146
+
-[x] thriller (214)
147
+
148
+
```js
149
+
{ keepZeroFacets :true } // default: false
150
+
```
100
151
101
152
## Example with InstantSearch
102
153
@@ -584,7 +635,7 @@ The `refinementList` widget is one of the most common widgets you can find in a
584
635
585
636
- ✅ container: The CSS Selector or HTMLElement to insert the refinements. _required_
586
637
- ✅ attribute: The facet to display _required_
587
-
- ✅ operator: How to apply facets, `and` or `or` (`and` is the default value).
638
+
- ✅ operator: How to apply facets, `and` or `or` (`and` is the default value). ⚠️ Does not seem to work on react-instantsearch.
588
639
- ✅ limit: How many facet values to retrieve.
589
640
- ✅ showMore: Whether to display a button that expands the number of items.
590
641
- ✅ showMoreLimit: The maximum number of displayed items. Does not work when showMoreLimit > limit.
0 commit comments