Applying Word Stemming in SearchView for fetch data from Firebase database

流过昼夜 提交于 2019-11-26 18:02:00

To achieve what you want, you need to execute a query which should look like this:

DatabaseReference rootRef = FirebaseDatabase.getInstance().getReference();
DatabaseReference usersRef = rootRef.child("users");
Query query = usersRef.orderByChild("name").equalTo(newText);

So everytime you create a search you should return a new query. So according to this, every time you want to filter on a new condition, you will need to:

  1. Create a new query based on the new filter:

    Query query = usersRef.orderByChild("name").equalTo(newText);
    
  2. Attach a listener to this new created query.

  3. Create a new adapter with the results of this new created query, or update the existing one using notifydatasetchanged() method.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!