Make links to matches on page with anchors when possible
When a search pattern is found in a title, the anchor for that title is present in the URL.
When the search pattern is found within a paragraph of a section with a title, the URL leads to a page without an anchor for the section's title, so you need to search for the word in the browser.
It seems like an important feature to get to the searched word on a page as quickly as possible.
I see a such plan of actions:
Possibly add some config key for search results with section's links - it will increase size of index, but not so much
For paragraphs in every section (h2,3,...) use array 'sections' like array 'titles'
Add every 'section' to the index like 'title' here - {doc.id}-{title.id}-content
Remove it from 'text'
What is left in 'text' will be 'text'
In output of search result here we can catch '-content' and format it with URL with anchor as for match in Title, but show content as 'text'
Is it good plan?