-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Add range matchers for site matrix vector store filtering #14401
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
Conversation
8d3b0c1 to
c2222cf
Compare
c2222cf to
7dc0fe2
Compare
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. |
7dc0fe2 to
25bc4cd
Compare
25bc4cd to
50b52d1
Compare
|
@jmooring If you could have a look/test this one and see if you agree. I have updated your demo in this branch bep/hugo-testing@f5f30ee Note that without end ranges, the mount order is important (higher up is weightier, also see my fix in #14405). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds range matcher support for site matrix vector store filtering, allowing users to filter versions, languages, and roles using comparison operators (>=, <=, >, <) in addition to the existing glob patterns. This enables more precise control over which versions should include specific content.
Changes:
- Added range operator parsing and predicate logic to support version/language/role filtering with comparison operators
- Modified interface signatures across the codebase to use
IndexStringinstead of raw strings for predicates - Changed
ResolveIndexmethods from panicking to returning -1 for not-found cases - Added comprehensive test coverage for range matchers with various combinations
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| common/predicate/predicate.go | Adds IndexString type, cutRangeOp function, and NewIndexStringPredicateFromGlobsAndRanges function to support range-based filtering |
| common/predicate/rangeop_test.go | Unit tests for cutRangeOp function |
| common/predicate/predicate_test.go | Comprehensive integration tests for range matchers with various patterns |
| langs/config.go | Updates IndexMatch signature and ResolveIndex to return -1 instead of panicking |
| hugolib/versions/versions.go | Updates IndexMatch signature and ResolveIndex to return -1 instead of panicking |
| hugolib/roles/roles.go | Updates IndexMatch signature and ResolveIndex to return -1 instead of panicking |
| hugolib/sitesmatrix/vectorstores.go | Updates filter creation to use new range-aware predicate function and simplifies iteration logic |
| hugolib/sitesmatrix/sitematrix_integration_test.go | Adds integration test demonstrating range matcher functionality with real Hugo site builds |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
Just seeing this now. I'll take it for a spin later today. |
|
I worked with the example site from https://discourse.gohugo.io/t/is-there-an-example-of-how-to-use-the-new-multidimensional-content-model/56516/4.
In the future we might consider |
Use range operators < <= > >= for version selection See <gohugoio/hugo#14401>
Thanks for this thorough rundown, much appreciated.
|
jmooring
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fixes #14359