https://en.wikipedia.org/w/index.php?title=Special%3ASearch&profile=advanced&search=insource%3A%22document.write%22&fulltext=Search&ns2=1&profile=advanced says "Results 1 - 20 of 229" currently, vs. over 11k with https://en.wikipedia.org/w/index.php?title=Special%3ASearch&profile=advanced&search=%22document.write%22&fulltext=Search&ns2=1&profile=advanced
I'm told there should be several thousand results in the User namespace for "document.write" on the English Wikipedia based on what mwgrep is reporting. I thought mwgrep used the same functional code/logic as insource: with Special:Search, but maybe not?