0

It turns out that searching through Firebase is case-sensitive, that's why I'm having empty results whenever I search for "hammer". I'm using FirebaseRecyclerOptions for searching and displaying the result in recycleview, code below:

        FirebaseRecyclerOptions<ProductModel> options =
            new FirebaseRecyclerOptions.Builder<ProductModel>()
                    .setQuery(FirebaseDatabase.getInstance().getReference().child("Products").orderByChild("name").startAt(str).endAt(str+"\uf8ff"), ProductModel.class)
                    .build();

Is there another way to search through the firebase while ignoring string case?

This is how the firebase looks like, thank you for the advice! enter image description here

lance2k
  • 357
  • 1
  • 4
  • 14
  • What exactly in this code doesn't work the way you expect? Tell us what is wrong with shared code. Do you have any errors? – Alex Mamo May 10 '22 at 06:56
  • No errors, it just does not display anything. No matter what I type in the search bar, it returns nothing. – lance2k May 10 '22 at 15:14
  • It turns out that searching through Firebase is case-sensitive, that's why I'm having empty results whenever I search for "hammer". – lance2k May 10 '22 at 15:47

0 Answers0