Search system / Система поиска

Good evening, tell me how to implement a search system on the pageOpera Снимок_2021-04-14_234349_skr.sh

For the data in the table (local), you can apply a filter:

image

To get server data (remote) use request:

image

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

Back to Flipabit >
Copyright © 2018. Flipabit Team. All rights reserved.