#How can i search in all collection together in simple request api? Search All.
15 messages · Page 1 of 1 (latest)
Thanks for posting! This is a community powered server, so you may or may not get an answer based on available help and expertise. To increase your chances of somebody being able to help you, please make sure your question includes the following:
- An explanation of exactly what you're trying to achieve.
- Any and all related code or previous attempts.
- The exact issue or error you are facing.
- Any screenshots if applicable.
When you're done with this thread, please close it.
(If you have a support agreement and need help, please contact the core team via email.)
You can query against one collection at a time
Yes, I can. But I'm looking for a global solution
No, sorry, I mean you can ONLY query against one collection at a time. It was an answer 😅
You could build a custom endpoint if you self-host, I guess, but it'll still be doing the multiple calls in the background.
No worries!
But you could create something like an index collection, which is populated by an flow everytime one of your actual collection is modified, using this, you can define which fields are “copied” to your index collection, and search afterwords within a single collection. The index could have fields like this:
IndexId, collection, itemid, searchableValue1, searchableValue2, ...
Doesn't sound like you have an ideal design model though
I have a directus project with a collection called callbacks, where the notifications sent by a marketplace are recorded by POST, with a variety of 18 different topics and several accounts from different sellers, this is how the records look in directus.
I have an index with the routes and the attributes so that through a flow it can search, update or register the resources in its corresponding collection.
Espero te sirva de inspiración 😁
Thanks, great idea.