Hi all,
I’m trying to create a universal search in my application that searches not only collections, but would also suggest app pages if they are relevant.
For example, if a user logs into the app and searches for “Users” it may suggest a list of user records, but may also suggest the “Users” page.
The pages result would need to be filtered by user permissions as some users may have access to the “users” page (continuing the example above), but others may not.
Whats the best way to structure that type of search?
Hi Esowers and welcome to our community 
this looks like an advanced functionality that depends on your backend.
My first tip to you is to try and search in the community if anyone else has had a similar search idea and how they tried solving it.
Hope this helps!
Hey Agustin,
I did search the community, but haven’t seen any similar posts/questions.
The backend would be Supabase, however, weweb pages aren’t necessarily created in the backend as they would be a part of weweb (they’re not dynamic pages).
Perhaps I just need to create a variable collection that identifies pages, urls and keywords, and have the search just look through that variable collection and when they click the link for the page it redirects to the page. Not sure if that’s the best approach though.
It sounds like what you’re really asking is, “How do I implement a search that spans multiple types of content?”, which is a bit more involved than just using WeWeb’s built-in search functionality.
When WeWeb performs a search, it’s referencing content that’s already been indexed or defined somewhere — so it knows where your search term exists (e.g., on a page, in a collection, etc.). If you want your search to return things like page names, user records, or blog titles, then your search UI needs to query something that contains all that data in a structured way.
I’m more of a designer than a developer, but conceptually, if this were a database query, it might look something like:
SELECT metadata FROM Pages, Users, Blogs WHERE metadata LIKE '%search_term%'
(obviously simplified — don’t judge!).
The key point is: your UI doesn’t know about all your app’s pages unless you explicitly define them somewhere. Since WeWeb pages aren’t necessarily dynamic or part of your Supabase backend, you might need to create a static or manually maintained collection (or “index”) that includes page titles, URLs, and maybe some tags/keywords. Then you can include that in your search logic and use it to redirect users appropriately based on permissions.
So yeah — your instinct about a “variable collection” sounds like a reasonable starting point.
3 Likes