Instantsearch.js: Sort by widget drop-down default selection

Created on 23 Jan 2018  路  3Comments  路  Source: algolia/instantsearch.js

Hi! I have a documentation issue on InstantSearch.js, I could not find what I was looking for which is:

We are using algolia with magento extension,
We are using sortBySelector widget.
Most relevant is the default selection of this drop-down no matter what we configured which attribute is first.
Where Should we modify to make a default selection like price for example.

Question

Most helpful comment

The default selection is based on the selected index. You can change the default index by modifying how InstantSearch.js is initialized:

const search = instantsearch({
  appId: 'latency',
  apiKey: '6be0576ff61c053d5f9a3225e2a90f76',
  indexName: 'instant_search', // << HERE
  searchParameters: {
    hitsPerPage: 8,
  },
});

You can change the index here: https://codesandbox.io/embed/vy4prppwmy

Does that solve your problelm @egyprotech ?

All 3 comments

The default selection is based on the selected index. You can change the default index by modifying how InstantSearch.js is initialized:

const search = instantsearch({
  appId: 'latency',
  apiKey: '6be0576ff61c053d5f9a3225e2a90f76',
  indexName: 'instant_search', // << HERE
  searchParameters: {
    hitsPerPage: 8,
  },
});

You can change the index here: https://codesandbox.io/embed/vy4prppwmy

Does that solve your problelm @egyprotech ?

@egyprotech any luck here?

Closing for inactivity.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

devwax picture devwax  路  3Comments

anthonyBertrant picture anthonyBertrant  路  3Comments

zackify picture zackify  路  4Comments

Spone picture Spone  路  3Comments

timkelty picture timkelty  路  3Comments