3 回答

TA貢獻1829條經驗 獲得超4個贊
這個問題可能很老,但是有一個文檔記錄了如何實現這種方法,實現起來很簡單。引用:
要啟用Cloud Firestore數據的全文本搜索,請使用第三方搜索服務(例如Algolia)??紤]一個做筆記的應用程序,其中每個筆記都是一個文檔:
阿爾戈利亞將成為您的一部分,firebase functions并將進行您想要的所有搜索。
// Update the search index every time a blog post is written.
exports.onNoteCreated = functions.firestore.document('notes/{noteId}').onCreate(event => {
// Get the note document
const note = event.data.data();
// Add an 'objectID' field which Algolia requires
note.objectID = event.params.noteId;
// Write to the algolia index
const index = client.initIndex(ALGOLIA_INDEX_NAME);
return index.saveObject(note);
});
要實現搜索,最好的方法是使用即時搜索-Android
- 3 回答
- 0 關注
- 617 瀏覽
添加回答
舉報