Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting filtering/searching across all levels and fields #169

Open
duglin opened this issue Sep 17, 2024 · 6 comments
Open

Supporting filtering/searching across all levels and fields #169

duglin opened this issue Sep 17, 2024 · 6 comments

Comments

@duglin
Copy link
Contributor

duglin commented Sep 17, 2024

Allow for something like: ?filter=any=foo
where it'll return any entity in the Registry that has "foo" and ANY field.

This is mainly for cases where people have a general sense of what they're looking for (e.g. "blob" related entities) don't know for sure which attribute the word "blob" will appear. It could be id, name, description, ... This feature will make life a bit easier for people to search large Registries.

Options:

  • ?filter=any=*foo*
  • ?filter=*=*foo*
  • ?search=*foo* same semantics as the others but w/o the need for a special attribute name. Of course, this mean remembering the two different query parameters.
@duglin
Copy link
Contributor Author

duglin commented Sep 17, 2024

GET /schemagroups?search=blob

Returns entities under /schemagroups that contain the phrase "blob". How this is done is an impl detail.

Optional to support.

Separate feature from "filter".

To discuss: search + filter at the same time???
e.g. GET /schemagroups?search=blob & label.deprecated=false

@duglin
Copy link
Contributor Author

duglin commented Sep 18, 2024

Given:

/groups/g1/resources/r1/versions/v1
/groups/g1/resources/r1/versions/v2
/groups/g1/resources/r2/versions/v1
/groups/g1/resources/r2/versions/v2
/groups/g2/resources/r11/versions/v1

GET /?search=r1 returns:

/groups/g1/resources/r1
/groups/g1/resources/r1
/groups/g2/resources/r11

GET /?search=1 returns all

GET /?search=2

/groups/g1/resources/r1/versions/v2
/groups/g1/resources/r2/versions/v1
/groups/g1/resources/r2/versions/v2
/groups/g2/resources/r11/versions/v1

GET /?search=2 & filter=groups.resources.id=r1

/groups/g1/resources/r1/versions/v2

GET /?search=2 & filter=groups.resources.id=r1 & filter=groups.id=g2

/groups/g1/resources/r1/versions/v2
/groups/g2/resources/r11/versions/v1

it becomes : search AND (filter1 OR filter2)

Algorithm: do 'search' and the apply the filters

@duglin
Copy link
Contributor Author

duglin commented Sep 19, 2024

We always return results as a sub-tree of the entire registry, but is that problematic if people want to know which entities actually matched w/o their parents getting in the way? E.g. how would I know if the parent matches the search criteria vs a leaf below it? ie. what if they both match?

Should a "search" return a map (xid / entity) instead of a single tree? If so, can inlining and filtering be supported at the same time - just apply it to each entity?

@duglin
Copy link
Contributor Author

duglin commented Sep 25, 2024

Proposal: array of entities (serialized json objects) - no inlining, no parents, no filtering (for now)

It's ambiguous when trying to figure out what the entity is by just the "self" URL, so this is another good reason for xid

@duglin
Copy link
Contributor Author

duglin commented Oct 30, 2024

Possibly related to: #139

Copy link

This issue is stale because it has been open for 30 days with no
activity. Mark as fresh by updating e.g., adding the comment /remove-lifecycle stale.

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

No branches or pull requests

1 participant