-
Notifications
You must be signed in to change notification settings - Fork 1
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
RFC: Nested Obj Filters #135
Comments
@dearsaturn @markrsocialnative you guys may be interested in this ^ |
If there is agreement on this approach, the next step would be figuring out the pseudo code for how nested filters should be applied in the filter application to the request object step. We can just post ideas inline here. |
How would the experience differ from an API perspective of this package? |
@dearsaturn good question. I was thinking that it wouldn't change. I'd like to perserve the public interface.
I think something like this would work. It follows the same pattern that exist for terms and match filters, but extends them with a |
In a similar vein, you could use the
|
In this case, is nestedObj a reference to a particular nested object field? |
In the above examples, |
Oh, I see. And |
@dearsaturn yeah exactly:
The first example in the readme is a pretty good way to get acquainted with the API. You basically have:
|
Got it. LGTM! |
This library currently does not support nested object filters. Additionally, I believe the current abstractions are partially incompatible with nested objects. Below is a proposal to support it:
Introspection step:
The object key should return a
nestedObj
type.For each key in the nested obj:
The fields and their type would be:
Filter step:
A new attribute is added to the
nestedObj
filter kind callednestedObjMap
. This is a map of parent keys to the nested object. This allows you to tell that the 3 keys above are all part of the same nested object.When a nested obj field filter is selected, the sibling fields are looked up in the
nestedObjMap
. This allows the filter to know which types are available on the nested object and which fields should be grouped together b/c they are part of the same nested object.From here, the logic is similar to a terms filter....i think.
The text was updated successfully, but these errors were encountered: