Good evening, tell me how to implement a search system on the page
For the data in the table (local), you can apply a filter:
To get server data (remote) use request:
Url to get filtered data:
https://YOUR_DB_NAME.firebaseio.com/posts.json?orderBy="FIELDNAME"&equalTo="SEARCHTEXT"
For example to get post with title equal to “Great post”:
https://YOUR_DB_NAME.firebaseio.com/posts.json?orderBy="title"&equalTo="Great post"
If you’re using orderBy, you need to define the keys you will be indexing on via the .indexOn rule in your Firebase Realtime Database Rules.
For example for title field you need to add:
"posts": {
".indexOn": ["title"]
}
Reed more:
https://firebase.google.com/docs/database/rest/retrieve-data
https://firebase.google.com/docs/database/security/indexing-data
1 Like
Could you make a video on this topic?