Looking for a cheap way to add full-text search to firestore

故事扮演 提交于 2019-12-10 20:00:49

问题


Here is what I want to do

Lets assume I have an Angular Dart application with a firestore backend that e.g. stores books. Each book has a title, a summary and a published date. Now I want to add a fulltext search with pagination to my app. Since firestore does not have fulltext search I need to add this myself if I want to have e.g the first 10 books containing "cat" ordered by published date.

Failed attempts

My first idea was to use the Elasticsearch docker container and deploy that on Google Cloud. Initially I tried to do this on Google Kubernetes but besides being a bit over-complicated it seems to cost way too much. Next I looked into Google App Engine with docker but this still seems to come up to 60$ per month since the Elasticsearch container needs 4GB ram.

So now I am stuck what to do. Look into Google Compute Engine and running docker inside a VM. I wonder how much that costs? Or maybe write something to interface with Google Cloud Search from a Google App instance exposing the results somehow?

All of this seems to be way to complicated for what I want to do. I might have like a thousand books to index which comes up to maybe 10MB in data and only a few thousand queries per month.


回答1:


Algolia seems like the perfect/best solution for your use case. It is SO easy to setup and is lightning fast. Have a look at their docs and pricing and test it out yourself. There’s also a sample firestore function that may interest you.



来源:https://stackoverflow.com/questions/50307572/looking-for-a-cheap-way-to-add-full-text-search-to-firestore

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!