Nuxt Swiftsearch
Getting Started

Migration from Vue InstantSearch

Move to Nuxt Swiftsearch while keeping a familiar declarative DX.

This page documents how Nuxt Swiftsearch reaches vue-instantsearch-like DX while preserving Nuxt SSR correctness.

1) Keep your component tree, switch the runtime

Most widget tags map 1:1 (AisSearchBox, AisHits, AisRefinementList, etc.).

Your primary change is at the root: Nuxt Swiftsearch owns the final widget registration to make SSR deterministic.

2) Start with declarative mode

If you omit :widgets on <AisInstantSearch>, the transform compiles template widgets into the same connector widgets you used to build manually.

SearchExperience.vue
<template>
  <AisInstantSearch :configuration="configuration">
    <AisSearchBox />
    <AisRefinementList attribute="brand" />
    <AisHits />
  </AisInstantSearch>
</template>

3) Keep manual mode where needed

Manual mode remains first-class and interoperable:

  • existing :widgets="[...]" code keeps working,
  • useAis* composables are unchanged,
  • you can mix manual pages and declarative pages in the same app.

4) Use indexId for multi-index boundaries

When multiple <AisIndex> instances use the same widget types, set index-id to ensure state isolation:

SearchExperience.vue
<AisInstantSearch :configuration="configuration">
  <AisIndex index-name="instant_search" index-id="products">
    <AisRefinementList attribute="brand" />
  </AisIndex>

  <AisIndex index-name="instant_search" index-id="accessories">
    <AisRefinementList attribute="brand" />
  </AisIndex>
</AisInstantSearch>

5) Widget-ID parity for repeated widgets

Repeated widgets that rely on explicit IDs (AisClearRefinements, AisCurrentRefinements, AisRefinementList, AisAutocomplete) now scope correctly per index and per widget ID.

Feature comparison

Comparison below is specifically about using these libraries in a Nuxt app.

CapabilityNuxt SwiftsearchVue InstantSearchComparison
SSR behavior in NuxtParent-owned widget graph, deterministic SSR/hydration flowClient-first widget registration modelBetter fit for Nuxt SSR
Declarative widget authoringSupported (compile-time transform to :widgets)Supported (runtime registration)Equivalent DX goal, different architecture
Existing manual :widgets modeFully supportedN/A (runtime declarative by default)Migration-safe advantage
Multi-index scoped stateExplicit indexId + scoped widget IDsMulti-index supportedBetter isolation guarantees in this module
Nuxt router integrationuseAisRouter() and custom routing patterns validated in playgroundRouting integration is not there out-of-the-box, also its not working server side.Better out-of-the-box for Nuxt
Parity validationDedicated fixture/e2e parity coverage in this repoUpstream library behavior baselineSwiftsearch is explicitly tested against Vue IS

Remaining differences

AreaCurrent Swiftsearch statusVue InstantSearch
AisInstantSearchSsr componentNot exposed separately; SSR is built into AisInstantSearchSeparate AisInstantSearchSsr component
Some advanced dynamic declarative structures (v-for widgets)Not transformed automatically; use manual :widgets modeSupported by runtime component registration

For a full widget-by-widget matrix against vue-instantsearch@4.24.3, see Widget Coverage & Upstream Audit.

Intentional differences

  • SSR model is parent-owned by design.
  • AisInstantSearchSsr behavior is merged into AisInstantSearch.
  • Some advanced dynamic widget patterns are intentionally routed through manual mode for predictability.
Migration strategy that works well: start with declarative mode for standard pages, then keep or reintroduce manual :widgets only where you need custom runtime composition.
Copyright © 2026