Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

centralised search #548

Open
cianfoley-nearform opened this issue May 24, 2018 · 0 comments
Open

centralised search #548

cianfoley-nearform opened this issue May 24, 2018 · 0 comments

Comments

@cianfoley-nearform
Copy link
Contributor

cianfoley-nearform commented May 24, 2018

I think it would be a good idea to have a centralised search endpoint as it would be nice to provide a consistent search across the entire db across all entities...

Here's a suggestion as to how it might be defined

/authorization/search/{teamId*}
?query=xyz
&searchtype=fulltext|startswith|exact|fuzzy
&entitytype=users|teams|policies|all
&field=id|name|description|meta.field
&recursive=true|false
&order=asc|desc
&limit=X
&page=Y 

If the teamId* route param is empty, search would look through the entire db

If a teamId(s) is specified here it could be referenced by path (which we return on teams endpoints) e.g.

/authorization/search/team1/team1-1

With no params set, it might return the teams entities (as per the team call) and so we could traverse the system with nice RESTful routing.

If search params are specified then it would search for children of the team specified only
i.e. look for sub teams, users and policies, depending on flags

E.g.

/authorization/search/team1/team1-1
?query=b
&searchtype=startswith
&entitytype=user
&field=name
&recursive=false
&order=asc

would would return all users in team1-1 with names starting with the letter b ordered alphabetically, which would be useful for an autocomplete component on a UI

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant