-
Notifications
You must be signed in to change notification settings - Fork 3
Add support for filtering to queryNearest #23
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
Open
mackinleysmith
wants to merge
4
commits into
get-convex:main
Choose a base branch
from
mackinleysmith:feat-nearest-filters-e2f8d
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add support for filtering to queryNearest #23
mackinleysmith
wants to merge
4
commits into
get-convex:main
from
mackinleysmith:feat-nearest-filters-e2f8d
+425
−34
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…rting options. Update README to reflect new options for maxDistance and filtering logic. Modify API definitions and implementations to support must/should filter conditions and sorting intervals. Add tests for new filtering functionality in closest point queries.
mackinleysmith
commented
Nov 6, 2025
Contributor
|
I’m planning to drop the cjs path and that statement entirely soon. Sorry
it bit you!
…On Thu, Nov 6, 2025 at 8:54 AM MacKinley Smith ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In package.json
<#23 (comment)>:
> @@ -23,8 +23,8 @@
"scripts": {
"build": "npm run build:esm && npm run build:cjs",
"build:go": "cd src/s2-bindings && python build.py",
- "build:esm": "tsc --project ./esm.json && echo '{\\n \"type\": \"module\"\\n}' > dist/esm/package.json",
- "build:cjs": "tsc --project ./commonjs.json && echo '{\\n \"type\": \"commonjs\"\\n}' > dist/commonjs/package.json",
+ "build:esm": "tsc --project ./esm.json && echo -e '{\n \"type\": \"module\"\n}' > dist/esm/package.json",
Oof... turns out that echo -e is not supported on macOS, so I'm updating
this to use a node script for full cross platform support. Another option
is to use printf, but that might lose compatibility with Windows.
I sure am shaving yaks today.
—
Reply to this email directly, view it on GitHub
<#23 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACZQW64KT5JNGJV4M4EOOL33N4NZAVCNFSM6AAAAACLHWDVKSVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTIMRZGM3DANRTGU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
sethconve
approved these changes
Nov 10, 2025
Author
|
Thank you for the approval, @sethconve! I have resolved the merge conflict on this branch and also opened another PR for my follow-on work to optimize the server-side aspect of this, #25. Please let me know if there's anything I can do to be helpful with getting this across the finish line. Cheers! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds filtering support to the
queryNearestmethod, allowing users to filter results using the same filter builder API available inquery. This addresses the feature request in #17 and the discussion in the Discord thread.Changes
queryNearestsignature: The method now accepts an options object that can include bothmaxDistanceandfilterparameters, while maintaining backwards compatibility with the existing numericmaxDistanceparameter.query:eq()- equality filtersin()- value in a set filtersgte()/lt()- sort key range filtersnearestPointsquery to accept filtering conditions and sorting intervals, passing them through toClosestPointQuery.Example Usage
Benefits
querymethodmaxDistancecontinues to workTesting
mustandshouldfilter conditions inpointQuery.test.tsBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.