Skip to content

Files

Latest commit

78042be · Jul 23, 2019

History

History

fulltext-search-firestore

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Mar 27, 2019
Jul 23, 2019
Oct 2, 2017
Sep 30, 2017

Full Text search via Algolia

This template shows how to enable full text search on Cloud Firestore documents by using an Algolia hosted search service.

Functions Code

See file functions/index.js for the code.

The dependencies are listed in functions/package.json.

Sample Cloud Firestore Structure

As an example we'll be using a secure note structure:

/notes
    /note-123456
        text: "This is my first note...",
        author: "FIREBASE_USER_ID"
    /note-123457
        text: "This is my second note entry...",
        author: "FIREBASE_USER_ID"
        tags: ["some_category"]

Whenever a new note is created or modified a Function sends the content to be indexed to the Algolia instance.

To securely search notes, a user is issued a Secured API Key from Algolia which limits which documents they can search through.

Setting up the sample

For setup and overview, please see the Full Text Search Solution in the Cloud Firestore documentation.