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

Make IndexResult always point to the start of the matched value #161

Closed
V0ldek opened this issue Jun 18, 2023 · 3 comments · Fixed by #162
Closed

Make IndexResult always point to the start of the matched value #161

V0ldek opened this issue Jun 18, 2023 · 3 comments · Fixed by #162
Assignees
Labels
area: result Improvements in query result reporting type: feature New feature or request
Milestone

Comments

@V0ldek
Copy link
Member

V0ldek commented Jun 18, 2023

Is your feature request related to a problem? Please describe.
Currently the IndexResult (and the -r bytes mode) return byte offsets that are "somewhere near" the matched value. This is pretty much useless for any serious application.

Describe the solution you'd like
It should always return the first byte of the matched value, be it the opening character of a complex subdocument, or the first character of an atomic value.

Additional context
Here's the values that are returned now:

  • For an empty query, the opening brace or bracket is returned, and atoms are ignored (see Atomic roots are not given as a result for an empty query $ #160).
  • For items that are located in an object, the colon of the matched key is returned.
  • For arrays:
    • an atom that is the first element gets the index of the opening bracket...
    • ... but a complex objects gets its opening character;
    • an atom that is a later element gets the index of the preceding comma...
    • ... but, again, complex objects get the opening character.
@V0ldek V0ldek added the type: feature New feature or request label Jun 18, 2023
@github-actions github-actions bot added the acceptance: triage Waiting for owner's input label Jun 18, 2023
@github-actions
Copy link

Tagging @V0ldek for notifications

@V0ldek V0ldek self-assigned this Jun 18, 2023
@V0ldek V0ldek added this to the v1.0.0 milestone Jun 18, 2023
@github-actions github-actions bot added acceptance: go ahead Reviewed, implementation can start and removed acceptance: triage Waiting for owner's input labels Jun 18, 2023
@V0ldek V0ldek added mod: engine area: result Improvements in query result reporting labels Jun 18, 2023
V0ldek added a commit that referenced this issue Jun 19, 2023
The `--result bytes` mode now consistently reports the first byte of the value it matched. This can be used to extract the actual value from the JSON by parsing from the reported byte.

Ref: #161
V0ldek added a commit that referenced this issue Jun 19, 2023
The `--result bytes` mode now consistently reports the first byte of the value it matched. This can be used to extract the actual value from the JSON by parsing from the reported byte.

Ref: #161
@github-actions github-actions bot removed the acceptance: go ahead Reviewed, implementation can start label Jun 19, 2023
@V0ldek
Copy link
Member Author

V0ldek commented Jun 19, 2023

Not fixed.

image

@V0ldek V0ldek reopened this Jun 19, 2023
@github-actions github-actions bot added the acceptance: triage Waiting for owner's input label Jun 19, 2023
@V0ldek V0ldek added acceptance: go ahead Reviewed, implementation can start and removed acceptance: triage Waiting for owner's input labels Jun 19, 2023
@V0ldek
Copy link
Member Author

V0ldek commented Jun 28, 2023

#170 fixes this

@V0ldek V0ldek closed this as completed Aug 2, 2023
@github-actions github-actions bot removed the acceptance: go ahead Reviewed, implementation can start label Aug 2, 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