I want to create a search function like facebook that help all user to search other user by more than one value under Users list in my application.
I read the example from here https://firebase.google.com/docs/database/admin/retrieve-data
here is my firebase :
I able to search the the user from firebase by "fullname" . here is my application :
usersRef = FirebaseDatabase.getInstance().getReference().child("Users");
Query searchAllQuery = usersRef
.orderByChild("fullname")
.startAt(searchBoxInput.toUpperCase())
.endAt(searchBoxInput.toLowerCase() + "\uf8ff" )
edited this is the code for my recycle view
FirebaseRecyclerOptions<SearchUserList> options =
new FirebaseRecyclerOptions.Builder<SearchUserList>()
.setQuery(searchAllQuery, SearchUserList.class).build();
I expected the output can be search by more that one value for example :
.orderByChild("fullname")
.orderByChild("username")
.orderByChild("country")
- when I key in USA , all user with value "usa" will show out.
- when I search for username "wei" ,users with value "wei" will show in the list