I have added this feature FEATURE: Match spaces in search with underscores in text by majakomel · Pull Request #5690 · discourse/discourse · GitHub
I figured out that underscores are not escaped in exact term when searching "enable_local_logins_via_email", so it already matches variations with different word sepataratos like enable local logins via email or enable+local+logins+via+email, I assume this is intended?
With the change I added, spaces in the exact search term match the text where any word separators are used, not only underscores.