Search code examples
androidgoogle-cloud-firestoresearchview

Searchview doesn't work when I type space for firestore adapter


I cant search with two word type like "jack jones" its only work for single word("jack") how can I figure it out? Here is my code:

private void searchData(String s) {
        adapter.stopListening();
        query = notebookRef.whereEqualTo("isim", s.toLowerCase()).orderBy("isim", Query.Direction.DESCENDING);
        FirestoreRecyclerOptions<Profiles> options = new FirestoreRecyclerOptions.Builder<Profiles>()
                .setQuery(query, Profiles.class)
                .build();
        adapter = new FirestoreAdapterForProfiles(options);
        recyclerView.setAdapter(adapter);
        adapter.startListening();


    }

Solution

  • ok I figured out here is the code that I changed:

    query = notebookRef.orderBy("isim").startAt(s.toLowerCase()).endAt(s+"\uf8ff");