Some search keywords, listed in QueryStringRegexParser::UNLIMITED_KEYWORDS, are allowed to have long parameter lists which do not count towards the query length limit. The way the code is written, the same exemption doesn't apply when the term is negated. Sometimes long negated terms can be useful (the specific use case I ran into is expressing "article does not have any ORES topic" - pointless in production but somewhat useful in a local environment for generating search data for pages). On the other hand the performance of the negated query is not necessarily the same as the performance of the original, so I'm not sure if it's same to assume that the negation of a long term is fine just because the original is fine. So, would it make sense to exempt negations?
Description
Details
Related Objects
Event Timeline
This makes perfect sense and I think this can be considered a bug. I think that the code simply ignores that the keyword node (in the AST) can be wrapped inside a NegatedNode and will incorrectly skip negated keywords.
Change 670168 had a related patch set uploaded (by Gergő Tisza; owner: Gergő Tisza):
[mediawiki/extensions/CirrusSearch@master] Extend query length limit exemptions to negated keywords
Change 670201 had a related patch set uploaded (by Gergő Tisza; owner: Gergő Tisza):
[mediawiki/extensions/CirrusSearch@master] Improve error message for query length limit violations
Change 670168 merged by jenkins-bot:
[mediawiki/extensions/CirrusSearch@master] Extend query length limit exemptions to negated keywords
Change 670201 merged by jenkins-bot:
[mediawiki/extensions/CirrusSearch@master] Improve error message for query length limit violations