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

Full subdocument result mode #56

Closed
V0ldek opened this issue Nov 25, 2022 · 1 comment · Fixed by #189
Closed

Full subdocument result mode #56

V0ldek opened this issue Nov 25, 2022 · 1 comment · Fixed by #189
Assignees
Labels
area: result Improvements in query result reporting type: feature New feature or request
Milestone

Comments

@V0ldek
Copy link
Member

V0ldek commented Nov 25, 2022

Is your feature request related to a problem? Please describe.
We need the actual full result mode – output the entire subdocument that matches the query.

Describe the solution you'd like
Consider the query $.a..b[*], and the JSON:

{
    "a": {
        "c": [
            { "b": [1, 2, 3] },
            { "d": { "b": { "x": true } } }
            { "b": { "b": { "b": "value" } } }
        ]
    }
}

Then in the output we should find all the following paths, separated with newlines:

1
2
3
true
"value"
{ "b": "value" }

Describe alternatives you've considered
Non-nested subdocument result mode tracked by #57

Additional context
This should be compatible with #54. Example output for the above JSON:

(1, $['a']['c'][0]['b'][0])
(2, $['a']['c'][0]['b'][1])
(3, $['a']['c'][0]['b'][2])
(true, $['a']['c'][1]['d']['b']['x'])
("value", $['a']['c'][2]['b']['b']['b'])
({ "b": "value" }, $['a']['c'][2]['b']['b'])
@V0ldek V0ldek self-assigned this Nov 25, 2022
@github-actions github-actions bot added the acceptance: triage Waiting for owner's input label Nov 25, 2022
@github-actions
Copy link

Tagging @V0ldek for notifications

@V0ldek V0ldek added this to the v1.0.0 milestone Nov 25, 2022
@github-actions github-actions bot added acceptance: go ahead Reviewed, implementation can start and removed acceptance: triage Waiting for owner's input labels Nov 25, 2022
@V0ldek V0ldek added type: feature New feature or request help wanted External contributions welcome acceptance: triage Waiting for owner's input mod: engine area: result Improvements in query result reporting acceptance: go ahead Reviewed, implementation can start and removed acceptance: go ahead Reviewed, implementation can start acceptance: triage Waiting for owner's input labels Nov 25, 2022
@V0ldek V0ldek removed their assignment Nov 25, 2022
@V0ldek V0ldek pinned this issue Jun 14, 2023
@V0ldek V0ldek self-assigned this Jun 18, 2023
@V0ldek V0ldek removed the help wanted External contributions welcome label Jun 18, 2023
@V0ldek V0ldek mentioned this issue Jul 14, 2023
3 tasks
V0ldek added a commit that referenced this issue Aug 2, 2023
This includes a revamp of all the internals that would be too long to describe in the log.
In short:
- `memmem` was rewritten to a custom implementation (courtesy of @charles-paperman)
- Each of the result modes has a separate `Recorder` that takes care of producing the results
- The results are written to a `Sink`, provided by the user; this might be a `Vec`, the stdout,
or some other `io::Write` implementation.
- Matches contain the full byte span of the value matched.
- A lot of `Input` and classifier APIs have massive breaking changes to accomodate this.

Ref: #56

Co-authored-by: cha <charles.paperman@univ-lille.fr>
@github-actions github-actions bot removed the acceptance: go ahead Reviewed, implementation can start label Aug 2, 2023
@V0ldek V0ldek unpinned this issue Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: result Improvements in query result reporting type: feature New feature or request
Projects
Status: Released
Development

Successfully merging a pull request may close this issue.

1 participant