0

I have a discussion collections with document like

{
name: John
date: 1 Jan 2021
time: 10am
discussion_note: this is the discussion text.
}

I have a search box, when the user types in say "discussion", I want to get all documents with "discussion" in discussion_note and return them to the user.

Since the result needs to populate with the user is typing, what's the most efficient way to query within the text in Firestore?

iamzeid
  • 104
  • 1
  • 2
  • 18
william007
  • 17,375
  • 25
  • 118
  • 194
  • 1
    Hello, look at the answer from Frank van Puffelen: https://stackoverflow.com/a/68226813/15943768 . I think Algolia is a good additional solution for text search operations in cloud firestore. – Marci Nov 30 '21 at 14:51

1 Answers1

1

@Marci is correct in directing you towards Frank van Puffelen's (Puf) answer in another post.

For those who can't be asked to follow said link and read through his answer, please read the following:

Firestore does not natively support text search, its searches are index based (which allow it to be quick, and is why you'll be prompted to create indexes for certain compound queries).
Puf's answer mentions the docs that Google provides for implementings Full-text search. The docs suggest using third party services, specifically:

Puf mentions Algolia specifically, the choice between them is rather subjective so I will not weigh in on it and would recommend that you read through each (as well as perform some searches on StackOverflow/Google for each, as how much you can depend on in-house and third-party documentation should be something you consider) before picking one over the other.

Jofre
  • 3,718
  • 1
  • 23
  • 31
fabc
  • 182
  • 10