search: add query parser migration flag
Created by: rvantonder
Second take in place of https://github.com/sourcegraph/sourcegraph/pull/11974 that introduces a flag in user/org/global settings (easier for dev/testing). The gist is we can check for the flag in Results()
based on a user setting and override the query there.
Small catch: the previous parsing code needs to stay in place because it sets the result for endpoints other than Results (Suggestions
and Stats
) and I don't want to duplicate this parsing code. This does mean that the parse tree can diverge along these though. Also, for stable:
to work, we need the logic that in Search(...) to happen before Results(), otherwise it doesn't set type:file
. Still figuring out if there's a better way.