0

In firestore database, there is a field for location, such as :

{
...
"location" : "London, England",
...
}

I want to get this for the search term : London/ london/ England/ england

So far I've tried this :

              Firestore.instance
              .collectionGroup("posts")
              .orderBy(location)
              .where(location,
                  isGreaterThanOrEqualTo: widget.location)
              .where(location,
                  isLessThanOrEqualTo: widget.location + "z")

How to solve this?

Newaj
  • 3,992
  • 4
  • 32
  • 50
  • if I understand well, are you trying to implement a no lower/upper case sensitive search? – andresmijares Feb 25 '20 at 16:47
  • You will need to store two versions of your data; a lower cased version and then a displayed version. Perform queries on the lower cased version and use the displayed version for the UI. – Jay Feb 25 '20 at 17:23
  • Yes, no case sensitive search. For the given example, I want to get the data for the terms "london" or "England" or "London" or "england". – Newaj Feb 25 '20 at 17:23
  • Yes? Meaning the issue is resolved? – Jay Feb 26 '20 at 15:36

0 Answers0