Skip to content

AO3-5984 Add max-min limits to int range searches#5935

Open
techlingyi wants to merge 6 commits into
otwcode:masterfrom
techlingyi:AO3-5984-int-range-limit
Open

AO3-5984 Add max-min limits to int range searches#5935
techlingyi wants to merge 6 commits into
otwcode:masterfrom
techlingyi:AO3-5984-int-range-limit

Conversation

@techlingyi

Copy link
Copy Markdown
Contributor

Pull Request Checklist

Issue

https://otwarchive.atlassian.net/browse/AO3-5984

Purpose

Adds an MAX_SEARCH_INT_RANGE: 2000000000 constant to config/config.yml and clamps all int-range searches (including num, <num, >num, and num1-num2) within the range 0 to MAX_SEARCH_INT_RANGE.

Since int ranges are all handled by the same function, this does go beyond the ticket for word count to also affect searches on hits count, kudos count, etc., but these statistics are also stored in MySQL int columns and so should also have the same maximum search limit. (They currently experience the same 500 error that word count does with numbers that are too large.)

Testing Instructions

(already touched on in the Jira issue but for the sake of completeness)

  • use all range search operators mentioned above in https://archiveofourown.org/works/search for the Word Count field, and ideally the Hits/Kudos/Comments/Bookmarks fields as well
  • pick any tag and use all range search operators mentioned above in the "Search within results" field of the Sort and Filter sidebar (e.g. ‵words:>10000000000000000000`; ideally test the hits, kudos, comments, bookmarks keywords as well)
  • pick any tag and activate the Word Count dropdown to fill in the From and To fields, one at a time and then both

Credit

Ling-Yi (any pronouns)

@techlingyi techlingyi marked this pull request as draft July 15, 2026 18:57
@techlingyi techlingyi marked this pull request as ready for review July 15, 2026 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant