#How can i search in all collection together in simple request api? Search All.

15 messages · Page 1 of 1 (latest)

scenic mountain
#

I need to search in more than 20 collections(tables) for an website cms search. How can i do this with directus api?

I need do specify table by table in my search? Or exists a easy way?

pseudo fractalBOT
#

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.)

mystic walrus
#

You can query against one collection at a time

scenic mountain
mystic walrus
#

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.

scenic mountain
#

Hahaha

#

Thanks Kevin

mystic walrus
#

No worries!

dreamy sage
#

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, ...

opal plover
#

Doesn't sound like you have an ideal design model though

pseudo pier
#

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 😁

scenic mountain
#

Thanks, great idea.