Searches are sent as you type, so it's not really that simple.
Firefox already does what you suggested when hitting enter in the default URL bar - if it's not a valid URL, it gets used as a search.
FWIW, I now see search bar has been off by default in firefox for the last 2 years (still grandfathered in for legacy users like me), so I think mozilla gave up on this. https://www.ghacks.net/2017/09/09/firefox-57-search-bar-off-...