NB: Since writing this post, I have moved my blog search engine into IndieWeb Search. The functionality should be similar but not exactly the same. With that said, the logic below is still accurate and I hope will be interesting to you.
I have been working on a feature for my blog search engine that aims to directly answer a question you have. This is a feature that many modern search engines like Google have. Google calls direct answers "featured snippets" wherein the search engine serves you content directly from a page to address your query. This way of rendering search results makes it easier for someone to find exactly what they want to know. If you want to know "What is the capital of Timor Leste?," it's more convenient to see that as the first search result rather than having to click on an article or two to find your answer.
I wanted to add a direct answer feature to my blog so that it is easier to find the content for which you are looking on a blog post. Rather than having to search through a blog post for an answer, you can find the answer to the question you have, the context surrounding that answer, and a link to a page where you can find out more information. In short, I see direct answers as a way to help you find answers to questions you have in less time than you otherwise would. And I see direct answers as a way to help point you to the most relevant article my search engine can serve you.
In this article I am going to briefly explain how my direct answers work.
How direct answers work: Indexing basics
My search engine crawls (reads) my site every day and saves all web pages into a database. This database is called the "index". I preserve the HTML of each web page which means I can later read the structure of each page in the index. This is important. Without indexing the HTML, I could not use the semantics on a web page to find information. This is what all search engines do. They use HTML tags to determine what information means based on the HTML tags in which the information is found. Information in a "