0

I have Users collection which contains user data I gathered from my app. I want to implement full-text search functionality in my app but so far all of the methods I tried didn't work for me. Also I don't want to use 3rd party options such as Algolia etc. What I exactly want to achieve is explained below:

Let's suppose user have a username "taylor_lee". When I type "tay" I want results to show "taylor_lee" and other usernames starting with "tay".

Any help is appreciated. Thank you in advance

RamammDev
  • 113
  • 1
  • 7
  • What's stoppin you? Can't you fetch everything and do a local search (I'm assuming there won't be millions of rows of data) – Vucko Apr 05 '21 at 14:49
  • 1
    The problem is I implemented the function but it only shows result when the username only equals to the input I entered. E.g. when I type "taylor_lee" it shows "taylor_lee" but when I type "tay" it shows no result. Also I think fetching everything can cause lots of reads in the future so I am trying to find the best solution for my case. – RamammDev Apr 05 '21 at 14:55
  • 1
    That's not a full-text search, it's a functionality that Firestore already provides. Please check the duplicate to see how you can solve that. If you want more than that, I recommend you also read this article, [How to filter Firestore data cheaper?](https://medium.com/firebase-tips-tricks/how-to-filter-firestore-data-cheaper-705f5efec444). – Alex Mamo Apr 05 '21 at 14:55
  • @AlexMamo you should have written an answer, I think this is exactly what the OP is looking for. – Vucko Apr 06 '21 at 08:24

0 Answers0