Skip to content

Algolia compatibility

Keep your index.search() calls. Results come from your documents, with the page.

Move search from Algolia to DocSlurp one call at a time. Keep your client code, then import settings, synonyms and rules from an Algolia or Elastic export.

On this page

Swap the client

Replace the Algolia client with the DocSlurp shim and keep your existing initIndex and search calls. Use a browser key restricted to your allowed websites.

search.tsSDK
import { docslurpAlgoliaClient } from '@docslurp/contrib-search-compat/algolia'

const client = docslurpAlgoliaClient({
  apiUrl: process.env.PUBLIC_DOCSLURP_API_URL,
  clientKey: process.env.PUBLIC_DOCSLURP_CLIENT_KEY // browser key (dslp_pub_), never a server key
})

const index  = client.initIndex(PROJECT_ID)
const result = await index.search({
  query:   'invoice',
  filters: 'tag:finance AND mime_type:application/pdf'
})

Supported endpoints: query, multipleQueries, facet search, settings, synonym batch sync, rule batch sync, analytics event intake, analytics summaries, and a generic importer for Algolia, Elastic and legacy parser metadata exports. Searches, reads and analytics events need a key with the search scope. Settings, synonym and rule writes and imports need a server key with the projects:manage scope, which only organization owners and admins can grant, and the key owner must be able to edit the project.

For the full adapter contract, see the Algolia integration guide.

Import an index export

Run the import with DOCSLURP_API_KEY set to a server key with the projects:manage scope. Without a credential, the command prints the normalized payload and skips the import; --out <file> also writes it to a file. --source is detected from the export when omitted.

TerminalCLI
docslurp import-search-compat export.json \
  --project <project-slug> \
  --source    algolia

Elastic exports map searchable fields and keyword facets into DocSlurp compatibility settings. Algolia exports keep settings, synonyms, rules, schema hints and migration metadata, so you can check what moved.

Jump to