Back

Query search or

  • 0
  • Flutter
sandeephifx
21 Jul, 2023, 11:04

Can we do Query.search in two attributes using “OR” like this database.listDocuments('employee_collection', [ Query.search('employee_name',searchtext), Query.search('employee_id', searchtext), ]);

TL;DR
It seems like the user wants to know if it's possible to perform a search query with multiple attributes using "OR". The recommended workaround is to add a separate attribute that combines all the data needed for searching. Additionally, a function can be used to automatically fill in this attribute to avoid manual input.
Binyamin
21 Jul, 2023, 16:23

You can upvote and track this feature request https://github.com/appwrite/appwrite/issues/2740

For now you can the recommend workaround is to add a seracs attribute that will contain all the data you want to be search able.

You can use a function that will trigger for any update/create events and do the filling there so you won't have to remember to do that.

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more