I got the solution. I just have to convert the string into lower case with toLowerCase(Locale.ENGLISH)
. Locale is helpful when we are doing case operations and URL related tasks. You can learn more about locale from https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html .
mItemList.clear();
mStore.collection("Featured").orderBy("name").whereLessThanOrEqualTo("name", newText.toLowerCase(Locale.ENGLISH)).get()
.addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() {
@Override
public void onComplete(@NonNull Task<QuerySnapshot> task) {
if(task.isSuccessful()) {
for(DocumentSnapshot doc:task.getResult().getDocuments()) {
Items f1 = doc.toObject(Items.class);
mItemList.add(f1);
Log.d("SearchItem", f1.getName());
}
mAdapter.notifyDataSetChanged();
}
}
});
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…