Google Firestore: Query on substring of a property value (text search)

前端 未结 16 1581
抹茶落季
抹茶落季 2020-11-22 12:08

I am looking to add a simple search field, would like to use something like

collectionRef.where(\'name\', \'contains\', \'searchTerm\')

I tried

16条回答
  •  误落风尘
    2020-11-22 12:39

    Per the Firestore docs, Cloud Firestore doesn't support native indexing or search for text fields in documents. Additionally, downloading an entire collection to search for fields client-side isn't practical.

    Third-party search solutions like Algolia and Elastic Search are recommended.

提交回复
热议问题