API Reference / InstantSearch.js Widgets / simple
Aug. 23, 2019
Widget signature
instantsearch.stateMappings.simple();

About this widget

You are currently reading the documentation for InstantSearch.js V4. Read our migration guide to learn how to upgrade from V3 to V4. You can still access the V3 documentation for this page.

The simple state mapping is used by default within instantsearch.

The only transformation applied by the function is the omission of configure.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
instantsearch.stateMappings.simple().stateToRoute({
  instant_search: {
    query: 'Apple',
    page: 5,
    configure: {
      hitsPerPage: 4,
    },
  },
});

// {
//   instant_search: {
//     query: 'Apple',
//     page: 5,
//   },
// }

Examples

1
2
3
4
5
6
instantsearch({
  // ...
  routing: {
    stateMapping: instantsearch.stateMappings.simple(),
  },
});

Did you find this page helpful?