Skip to content

Commit

Permalink
feat(instantsearch): add support for hitsPerPage configuration (#74)
Browse files Browse the repository at this point in the history
* feat(instantsearch): add support for hitsPerPage configuration

* docs(instantsearch): document hitsPerPage option
  • Loading branch information
Jerska authored Sep 20, 2018
1 parent eee51c1 commit 66f1a20
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ Here is a full breakdown of the available options for the JavaScript library:
},
instantsearch: {
enabled: true, // is the instantsearch feature enabled?
hitsPerPage: 20, // the number of suggestions to display
paginationSelector: '.pagination', // the DOM selector for the current pagination (to hide it)
reuseAutocomplete: false, // do not add a search input for the instant-search page
hideAutocomplete: true, // whether or not to hide the autocomplete on the instantsearch page (ignored if reuseAutocomplete is used)
Expand Down
1 change: 1 addition & 0 deletions app/src/AlgoliasearchZendeskHC.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const optionsStructure = {required: true, type: 'Object', children: {
indexPrefix: {type: 'string', value: 'zendesk_'},
instantsearch: {type: 'Object', value: {}, children: {
enabled: {type: 'boolean', value: true},
hitsPerPage: {type: 'number', value: 20},
paginationSelector: {type: 'string', value: '.pagination'},
reuseAutocomplete: {type: 'boolean', value: false},
hideAutocomplete: {type: 'boolean', value: true},
Expand Down
2 changes: 2 additions & 0 deletions app/src/instantsearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class InstantSearch {
highlightColor,
instantsearch: {
enabled,
hitsPerPage,
selector,
paginationSelector,
reuseAutocomplete,
Expand Down Expand Up @@ -190,6 +191,7 @@ class InstantSearch {
this.instantsearch.addWidget(
instantsearch.widgets.hits({
container: '#algolia-hits',
hitsPerPage,
templates: {
empty: templates.instantsearch.noResult,
item: templates.instantsearch.hit
Expand Down
1 change: 1 addition & 0 deletions docs/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ Here is a full breakdown of the available options for the JavaScript library:
},
instantsearch: {
enabled: true, // is the instantsearch feature enabled?
hitsPerPage: 20, // the number of suggestions to display
paginationSelector: '.pagination', // the DOM selector for the current pagination (to hide it)
reuseAutocomplete: false, // do not add a search input for the instant-search page
hideAutocomplete: true, // whether or not to hide the autocomplete on the instantsearch page (ignored if reuseAutocomplete is used)
Expand Down

0 comments on commit 66f1a20

Please sign in to comment.