The search box in the HA documentation can be spectacularly unhelpful. Try searching for sensor.
However, you can improve your results a bit by using some basic search operators.
The first thing to understand is that searches are AND by default. So if you search for on error you will get results that include on AND error, but not necessarily in that order, and not necessarily together.
To search for the specific phrase on error you need to enclose the words in quotes.
To search for the word error and exclude results for on error, use a minus sign.
To search for documentation containing either error or on (Why would you? But just as an example…), use OR.
The search box in HA documentation is powered by Algolia. If you’re interested in how it works you can find documentation here - but it is not user documentation:
Often, a Google site search will be more effective than using the Documentation search box. There is another community guide on using it to search the forum, and the same principles apply:
Tips on Searching for Answers & Duplicate Topics in the Forum
To see only the Home Assistant Docs, use:
site:www.home-assistant.io on error
If you want to see only what’s in the Community Forum, use:
site:community.home-assistant.io on error
Google also has an advanced search page.