0.6.1 • Published 3 years ago

firestore-full-text-search v0.6.1

Weekly downloads
201
License
Apache-2.0
Repository
github
Last release
3 years ago

Firestore Full-Text Search

Firestore Full-Text Search provides a Firestore-specific full-text search function.
It runs on Cloud Functions and has excellent performance.
Supports simple inverted index type search.

Usage

npm install --save firestore-full-text-search
import admin from 'firebase-admin';
import FirestoreFullTextSearch from 'firestore-full-text-search';

admin.initializeApp({...});
const db = admin.firestore();

// Specifies the collection in which to store the inverted index.
const fullTextSearch = new FirestoreFullTextSearch(db.collection('index'));


// Set documents
const postData: Post = {
    title: "What's Firestore Full-Text Search?",
    content:
    'Firestore Full-Text Search provides a Firestore-specific full-text search function. It runs on Cloud Functions and has excellent performance.',
    created: admin.firestore.FieldValue.serverTimestamp(),
};

const docRef = postsRef.collection('posts').doc('1');

// WriteBatch is supported so that documents and search indexes can be stored atomically.
const batch = db.batch();
batch.set(docRef, postData);
await fullTextSearch.set('en', docRef, {batch, data: postData});
await batch.commit();
// Search documents
const results = await fullTextSearch.search('en', 'firestore');

ToDo

  • English Support
  • Japanese Support
  • Implement Query parser
  • Implement Delete document
  • Sorting Support
  • Limit Support
  • Pagination Support
  • OpenTelemetry Support
  • Browser Support (Search-Only)
  • Firebase Performance Monitoring Support
0.6.1

3 years ago

0.6.0

3 years ago

0.5.0

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.3.0

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago