Migrating from Algolia
Step-by-step guide to migrate your search from Algolia to AACsearch Engine — index migration, API key porting, and widget replacement.
Migrating from Algolia
This guide walks you through migrating your search infrastructure from Algolia to AACsearch Engine. The process is designed for minimal downtime and can be completed in a few hours for most setups.
Migration overview
| Step | What you do | Duration |
|---|---|---|
| 1 | Export your Algolia index | ~5 minutes |
| 2 | Create an AACsearch index | ~5 minutes |
| 3 | Import data | ~10 minutes |
| 4 | Configure settings (facets, synonyms, ranking) | ~15 minutes |
| 5 | Update API keys | ~10 minutes |
| 6 | Update your frontend | ~30 minutes |
| 7 | Switch DNS / endpoints | ~5 minutes |
Step 1: Export your Algolia index
Use the Algolia CLI or API to export your index data:
# Install Algolia CLI
npm install -g algolia-cli
# Export index to JSON
algolia export \
--app-id YOUR_ALGOLIA_APP_ID \
--api-key YOUR_ADMIN_API_KEY \
--index-name your_index_name \
--output ./algolia-export.jsonAlternatively, use the Algolia API directly:
curl "https://YOUR_APP_ID.algolia.net/1/indexes/YOUR_INDEX_NAME/browse" \
-H "X-Algolia-API-Key: YOUR_ADMIN_API_KEY" \
-H "X-Algolia-Application-Id: YOUR_APP_ID" \
| jq '.hits' > algolia-export.jsonStep 2: Create an AACsearch index
In the AACsearch dashboard or via API:
curl -X POST "https://app.aacsearch.com/api/projects/YOUR_PROJECT_ID/indexes" \
-H "Authorization: Bearer YOUR_ADMIN_KEY" \
-H "Content-Type: application/json" \
-d '{
"slug": "your_index",
"displayName": "Your Index",
"fields": [
{"name": "objectID", "type": "string"},
{"name": "title", "type": "string"},
{"name": "description", "type": "string"},
{"name": "price", "type": "float", "sort": true},
{"name": "category", "type": "string", "facet": true},
{"name": "brand", "type": "string", "facet": true},
{"name": "tags", "type": "string[]", "facet": true}
],
"defaultSortingField": "price"
}'Field mapping tip: Map
objectID→idorexternal_id. AACsearch usesidas the primary key for upserts and deletes. If your Algolia records useobjectID, include anidfield in your export or map it during import.
Step 3: Import data
# Transform objectID to id
cat algolia-export.json | jq '[.[] | {id: .objectID, title, description, price, category, brand, tags}]' > import-data.json
# Batch import
curl -X POST "https://app.aacsearch.com/api/indexes/YOUR_INDEX_ID/documents:batch" \
-H "Authorization: Bearer YOUR_ADMIN_KEY" \
-H "Content-Type: application/json" \
-d @import-data.jsonStep 4: Configure settings
Facets
Map your Algolia attributesForFaceting to AACsearch facet: true fields. AACsearch supports the same facet types:
| Algolia | AACsearch | Notes |
|---|---|---|
searchable(attribute) | type: "string", facet: true | Filter-only facet |
filterOnly(attribute) | type: "string", facet: true, filterOnly: true | No facet count returned |
| Hierarchical | type: "string[]" | Use array fields for hierarchy |
Synonyms
Export Algolia synonyms and import them to AACsearch:
# Export Algolia synonyms
curl "https://YOUR_APP_ID.algolia.net/1/indexes/YOUR_INDEX_NAME/synonyms" \
-H "X-Algolia-API-Key: YOUR_ADMIN_API_KEY" \
-H "X-Algolia-Application-Id: YOUR_APP_ID" \
| jq '.hits' > algolia-synonyms.json
# Convert to AACsearch format (one-way synonyms)
cat algolia-synonyms.json | jq '[.[] | select(.type == "synonym") | {root: .word, synonyms: (.synonyms // [])}]' > aacsearch-synonyms.json
# Import
curl -X PUT "https://app.aacsearch.com/api/indexes/YOUR_INDEX_ID/synonyms" \
-H "Authorization: Bearer YOUR_ADMIN_KEY" \
-H "Content-Type: application/json" \
-d @aacsearch-synonyms.jsonRanking
AACsearch's default ranking (Typo → Proximity → TextMatch → Custom) is comparable to Algolia's default ranking strategy. To replicate custom ranking:
curl -X PATCH "https://app.aacsearch.com/api/indexes/YOUR_INDEX_ID" \
-H "Authorization: Bearer YOUR_ADMIN_KEY" \
-H "Content-Type: application/json" \
-d '{
"ranking": {
"textMatchWeight": 3,
"proximityWeight": 2,
"typoWeight": 1,
"fieldWeights": {"title": 5, "description": 2}
}
}'Step 5: Update API keys
Create new API keys in the AACsearch dashboard:
- Admin key (
aa_admin_*) — full CRUD access, for backend services - Search key (
ss_search_*) — search-only access, safe for browser use - Scoped tokens (
ss_scoped_*) — restricted to specific index and filters
Replace your Algolia search-only API key with an AACsearch ss_search_* key in your frontend.
Step 6: Update your frontend
Replace the InstantSearch client
Before (Algolia):
<script src="https://cdn.jsdelivr.net/npm/algoliasearch@4/dist/algoliasearch-lite.umd.js"></script>
<script>
const searchClient = algoliasearch("APP_ID", "SEARCH_KEY");
// ...
</script>After (AACsearch Engine):
<script src="https://cdn.aacsearch.com/widget/v1/widget.js"></script>
<script>
const search = new AacsearchWidget.Search({
baseUrl: "https://app.aacsearch.com",
apiKey: "ss_search_YOUR_KEY",
indexSlug: "your_index",
});
</script>Query translation reference
| Algolia | AACsearch |
|---|---|
index.search(query, { filters }) | client.search({ q: query, filterBy: filters }) |
index.search(query, { facetFilters }) | client.search({ q: query, filterBy: filters, facetBy: attributes }) |
index.search(query, { hitsPerPage }) | client.search({ q: query, perPage: n }) |
index.search(query, { page }) | client.search({ q: query, page: n }) |
index.search(query, { attributesToRetrieve }) | — all fields returned by default; use includeFields to limit |
index.search(query, { sort }) | client.search({ q: query, sortBy: "field:asc" }) |
index.searchForFacetValues(...) | client.search({ q: query, facetBy: "field", maxFacetValues: n }) |
Step 7: Switch DNS / endpoints
Once you've verified everything works:
- Update your backend services to point to
https://app.aacsearch.com(or your EU/RU node) - Update your frontend widget to use the AACsearch endpoint
- Keep your Algolia index as a backup during the transition period
- Verify search results match expectations
- Decommission Algolia (or keep as cold standby)
Rollback plan
If something goes wrong during migration:
- Revert your frontend to the Algolia client
- Keep both indexes in sync during the transition
- Re-run the import if data is incomplete
API equivalence reference
| Feature | Algolia | AACsearch |
|---|---|---|
| Search | index.search() | POST /api/v1/indexes/:slug/search |
| Multi-search | multipleQueries() | POST /api/v1/multi-search |
| Faceting | attributesForFaceting | Field facet: true in schema |
| Synonyms | saveSynonym() | PUT /api/indexes/:id/synonyms |
| Curations (Rules) | saveRule() | PUT /api/indexes/:id/curations |
| Typo tolerance | typoTolerance | typoTolerance in index config |
| Analytics | getAnalytics() | GET /api/projects/:id/analytics |
| API keys | apiKey / securedApiKey | Admin/Search/Scoped token model |
Need help?
- Connector API Reference
- Node.js SDK
- Contact support at support@aacsearch.com
From database search (SQL LIKE / FTS)
Migrating from `LIKE %query%`, MySQL fulltext, PostgreSQL `tsvector`, or any other database-native search to AACsearch.
Migrating from Elasticsearch
Step-by-step guide to migrate your search from Elasticsearch to AACsearch Engine — index mapping, reindexing, and query translation.