I have some documents with two arrays, one for the search functionality (keywords) and one to filter by services, using a single whereArrayContains or whereArrayContainsAny works perfectly. If I use them both together to get the documents both having the keywords for the search functionality and having at least one of the selected services it gets stuck in the loading state and never returns anything. For context I'm using jetpack compose with compose pager for the lazyColumn showing the documents.
This Works:
FirebaseFirestore.getInstance().collection("Clubs")
.whereArrayContainsAny("services", sportsFilters)
.get()
.await()
This also Works:
FirebaseFirestore.getInstance().collection("Clubs")
.whereArrayContains("keywords", searchString.lowercase().trim())
.get()
.await()
This is not Working:
FirebaseFirestore.getInstance().collection("Clubs")
.whereArrayContains("keywords", searchString.lowercase().trim())
.whereArrayContainsAny("services", sportsFilters)
.get()
.await()