score:0

i figured out how to do this using virtualwidgets.

https://community.algolia.com/react-instantsearch/connectors/connectmenu.html

the scope an index to a particular attribute i used the following method:

import { connectmenu } from 'react-instantsearch/connectors';
const virtualmenu = connectmenu(() => null);
// reset of component code
<instantsearch
    appid="kjh78673iuh"
    apikey="e55e048w7fh8wh8wrgh834c3ea51e3"
    indexname="events"
  />
    <configure hitsperpage={10} />
    <virtualmenu attribute="site_id" defaultrefinement="1" />
    <searchbox />
    <h3>latest events</h3>
    <hits />
    <index indexname="venues">
      <h3>latest venues</h3>
      <hits />
    </index>
    <index indexname="users">
      <h3>latest users</h3>
      <hits />
    </index>
  </instantsearch>

you can also add the virtualwidget to the index block itself too.


Related Query

More Query from same tag