Skip to content

Commit

Permalink
fix(instantsearch): pagination issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerska committed Dec 20, 2016
1 parent 4bbca25 commit 0ba3e0b
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions app/src/instantsearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,14 @@ class InstantSearch {
highlightPostTag: '</span>',
snippetEllipsisText: '...'
},
searchFunction: helper => {
const query = helper.state.query;
searchFunction: ({search}) => {
let helper = this.instantsearch.helper;
const query = helper.getQuery();
const optionalWords = getOptionalWords(query, this.locale);
this.instantsearch.helper.setQueryParameter('optionalWords', optionalWords);
helper.search();
const page = helper.getPage();
helper.setQueryParameter('optionalWords', optionalWords);
helper.setPage(page);
search();
}
});

Expand Down Expand Up @@ -111,7 +114,9 @@ class InstantSearch {
getConfiguration: () => ({facets: ['locale.locale']}),
init: ({helper}) => {
// Filter by language
const page = helper.getPage();
helper.addFacetRefinement('locale.locale', this.locale);
helper.setPage(page);
}
});

Expand Down

0 comments on commit 0ba3e0b

Please sign in to comment.