Page MenuHomePhabricator

Clean up documentation for regex searches
Closed, ResolvedPublic3 Estimated Story Points

Description

It seems that (if I'm taking @TJones' comment at T410758#11410188 correctly) that regex searches are first preprocessed to find sections that can be matched via the index, and in particular that if a regex search has no non-escaped metacharacters (and is thus looking for some exact string) then it will be almost as fast as an index search (one would want to do this sort of "regex" to search for an exact string without applying grayspace filters, for example).

This contradicts the documentation at https://www.mediawiki.org/wiki/Help:CirrusSearch#Regular_expression_searches which implies such things need an indexed precomponent to be efficient. Could the documentation for regex searches please be updated to show how the software actually behaves?

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
pfischer set the point value for this task to 2.Dec 1 2025, 4:57 PM
TJones changed the point value for this task from 2 to 3.

Started looking at this, and it's a little harder to match the style and tone than I expected.

I've made some edits and added some information. I will try to finish reviewing the rest of the section tomorrow to soften the language throughout from "never do use a bare regex" to "try no to use bare regexes". (Though if someone beats me to it, I won't complain!)

TJones added a subscriber: Shirayuki.

Okay, I think I'm done with the updates. (Thanks to @Shirayuki for marking them for translation and making a few other updates, too.)

If anyone else wants to take a minute to read over my & Shirayuki's changes, or just read the current section, that'd be great, too.

That's definitely clearer, thanks. I did https://www.mediawiki.org/w/index.php?title=Help:CirrusSearch&diff=8055397&oldid=8055177 to hopefully make it more clear and tone down the repetition slightly.

@Pppery, thanks for your bolder edits. I'm always a little hesitant to jump in and make sweeping changes from my WMF account. I appreciate you taking the info I was able to provide and editing it into shape! If you feel like things are done, we can move this ticket to "Done" on the Discovery workboard.