Skip to content

Support Catalog Number ranges in Query Builder 'In' filters#7814

Open
acwhite211 wants to merge 5 commits intomainfrom
issue-6399
Open

Support Catalog Number ranges in Query Builder 'In' filters#7814
acwhite211 wants to merge 5 commits intomainfrom
issue-6399

Conversation

@acwhite211
Copy link
Member

@acwhite211 acwhite211 commented Mar 15, 2026

Fixes #6399

Restore Specify 6-style Catalog Number Numberic range behavior for Query Builder In filters. Users can now enter values like 33043-33049, 352000-26, 352028-49, 33040 and get expected results.

Added supporting functions to the Query Operators to handle the parsing of catalog number ranges. Kept mixed-token behavior, so single values and ranges can be combined in one In clause. Added unit test coverage for the new range behavior.

Currently designed and working for CatalogNumberNumeric formats. Supporting the other CatalogNumber, CatalogNumberAlphaNumByYear, and CatalogNumberString formats could possibly be done in the future.

image image

Checklist

  • Self-review the PR after opening it to make sure the changes look good and
    self-explanatory (or properly documented)
  • Add relevant issue to release milestone
  • Add pr to documentation list
  • Add automated tests

Testing instructions

  • Go to the collection object query builder page.
  • Run a query on the catalog number field and see the results, and pick out a range of catalog numbers that can be used for a range query test. Note down how many records should appear for a given range.
  • In the catalog number field, select the "In" operator.
  • In the adjacent textbox, write a range of catalog numbers separated by a dash, ex. 33043-33049
  • See that the correct number of records are returned for the given catalog number range.
  • Try out using shorthand notation, remove some of the leading numbers in the second range number, ex. 33043-49.
  • See that the correct number of records are returned for the given catalog number range.
  • Try just putting in a single catalog number to make sure that still works, ex. 33043
  • See that one record is returned.
  • Lastly, try a combination of range queries, ex. 33043-48, 33049.
  • See that the correct number of records are returned for the given catalog number range.
  • Find or create a discipline/collection that uses the CatalogNumberAlphaNumByYear formatting. See that a range of catalog numbers still works for the "In" operator.

@acwhite211
Copy link
Member Author

Currently working for CatalogNumberNumeric. Working on trying to add support for CatalogNumberAlphaNumByYear.

@acwhite211 acwhite211 marked this pull request as ready for review March 16, 2026 22:03
@acwhite211 acwhite211 requested review from a team and alesan99 March 16, 2026 22:03
Copy link
Contributor

@alesan99 alesan99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • See that the correct number of records are returned for the given catalog number range.
  • See that the correct number of records are returned for the given catalog number range.
  • See that one record is returned.
  • See that the correct number of records are returned for the given catalog number range.
  • Find or create a discipline/collection that uses the CatalogNumberAlphaNumByYear formatting. See that a range of catalog numbers still works for the "In" operator.

Everything worked for me in both CalalogNumberNumeric and CatalogNumberAlphaNumberByYear 👍

For query:
2-10, 11, 100-20
Image

Input validation is missing, something like 1-99999999999 won't show any results but it won't let the user know its because 99999999999 doesn't follow the format. But I think its reasonable for users to assume that IN queries must follow the same formatting rules as other queries, so I think its fine for this PR at least

@alesan99 alesan99 requested a review from a team March 17, 2026 16:38
Copy link
Contributor

@Iwantexpresso Iwantexpresso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • See that the correct number of records are returned for the given catalog number range.

  • See that the correct number of records are returned for the given catalog number range.

  • See that one record is returned.

  • See that the correct number of records are returned for the given catalog number range.

after attempting a combination of ranges in the wrong order, the parser seems to go over based on the next interval of 10 numbers rather than backwards rather than the behavior seen with interval 6-1

Image Image

NOTE: these are both rough cases so its understandable if it stays in. this is more of stress test. th only thing that worried be about it is the inconsistency between them since the 6-1 interval covered CO's 1-6 while the interval 10-7 seems to be interpreted as range 10 + 7 more after that rather than a backwards range as its seen with the first example.

  • Find or create a discipline/collection that uses the CatalogNumberAlphaNumByYear formatting. See that a range of catalog numbers still works for the "In" operator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 📋Back Log

Development

Successfully merging this pull request may close these issues.

Add support for dash-separated ranges in the Query Builder

4 participants