How to breakdown a document by sections?

Hi everyone, I’d like to have your opinion on this.

Use case: Crawl a knowledge base web page and breakdown each section based on h1, h2, h3, h4, h5, h6 html tags, so each section corresponds to a search result.

Question: What’s the best way to tackle this problem with Algolia? Is it to first breakdown the web page in sections and to treat each section as a document? Or is it to treat the whole web page as a document and to configure Algolia accordingly?

Thanks for your help!

Hi @dionne.phil! Thanks for asking your question.

I would recommend creating one record per section of the page, where the section contains no more than 1-2 paragraphs of text. That will ensure the best relevance and speed for the search.

This is how Algolia’s DocSearch project indexes technical documentation sites, including preserving the hierarchy (h1, h2, etc.) for tuning relevance (to make matches in “h1” matter more than matches in “p” for example).

Awesome! Thanks for the tips!

1 Like