Suggestions

Products & Resources

How Firestore search with Algolia works

Keep Firestore as your source of truth. Configure the extension to watch a collection and send selected document fields to an Algolia index. New documents, updates, and deletions are propagated to the index asynchronously. Your app queries Algolia to retrieve matching records and display results.

1 - Source
Firestore collection

Your documents stay in Cloud Firestore. Writes happen as usual.

2 - Sync
Extension / Cloud function

Watches the collection and sends selected fields on create, update, and delete. 

3 - Index
Algolia index

Records are indexed with your searchable attributes, ranking, and filters. 

4 - Query
Search UI

Your app queries Algolia and renders matching results for users. 

  • Configure what syncs
    Choose the fields to index, your collection path, Algolia application and index, and whether to index existing documents. 

  • Restrict the indexing key
    Use a dedicated restricted indexing key for the extension. 

  • Add a search interface
    Add a search interface to your application using Algolia's InstantSearch libraries. 

Build a search experience your users can explore

Search as users type

Query your Algolia index from your application and render matching results without querying Firestore for every keystroke.

Handle imperfect queries

Configure typo tolerance and synonyms so users can find relevant results even when they misspell a word or use different terminology.

Filter and refine

Add filterable attributes such as category or status, and build filters and facets around your data.

Tune relevance

Choose searchable attributes and adjust ranking to fit your content, products, or application.

Add an agent

Publish your index as an MCP to power retrieval for agentic experiences. 

Explore analytics

Understand the performance of your search, and how your users interact with your app through search and click analytics.

Get started

1
Prepare your projects

Create an Algolia application and an index, and set up a Cloud Firestore in a Firebase Project on the Blaze plan. Review the extension's current requirements and Firebase's migration guidance.

2
Configure the extension

Select your Firestore database and collection path, fields, Algolia index, application ID, and a dedicated indexing key with the permissions listed in the extension configuration. Select the full indexing option if you want to backfill existing documents. 

3
Verify synchronization

Add, edit, and delete a test document. Check the Algolia index and extension audit logs to confirm the expected records and fields appear or disappear. 

4
Add search to your app

Send queries to the Algolia index using a search-only key for data intended to be public. Render hits in your UI. For private or tenant-specific data intended to be public, implement the authorization pattern below before exposing results. 

Design for low-latency and fresh data

Algolia handles search queries while Firestore changes sync to index asynchronously. Monitor function errors and indexing lag, and decide how your UI should behave while changes are still propagating. Measure both sides of the experience: 

Search latency

Track the time from a client's query to its response. Network conditions and traffic can affect the result. 

Indexing freshness

Track the time from a Firestore write until the change is searchable. Function execution and indexing can affect the delay. 

Build search for multiple users and tenants

Build search for multiple users or tenants with Algolia-secured search keys. Firestore Security Rules don't automatically apply to records queried from Algolia. 

01
Index what you need

Index only the fields you need, including filterable attributes that define each record’s authorized users or tenants.

02
Verify the user

Verify the user’s Firebase ID token on a trusted backend. Determine their access scope and issue a short-lived secured search key with enforced filters and index restrictions.

03
Issue a secured key

Keep parent and indexing keys on the server. Client-supplied filters alone don’t enforce access.

04
Query with the scoped key

Test isolation, permission changes, and deletions. Account for sync delays that can leave old records or permissions searchable until updates are processed.

Algolia-Firebase FAQs