Is it possible to link to the most relevant anchor in the page?

For example, if the search term is only found under a heading with an anchor or ID, the search result could link directly to that heading.

Eg: Result for query thingamabobs could like direct to #section-3

<h3 id="section-3">Section Three</h3>
<p> This section is about thingamabobs, read on for more...</p>

If not natively supported, perhaps could it be done by processing at crawl time and treating each section as a different document?

Ello ello!

Sadly, Funnelback does not do anything like that out of the box. However, you can achieve something similar to what you mentioned by using filters to split the document and result collapsing to combine it back together.

Something like:

  • Create a filter which splits one html document into multiple documents where each document represents a section. As part of the splitting process, record some ID to determine which document it was split from.
  • At query time, enable result collapsing based on the ID of the source document. This ensure that only one document is shown for each source document.

There is a caveat though. Splitting up documents means you will lose anchor references which may negatively affect rankings. This approach would be suitable for things like indexing textbooks with multiple chapters but less idea for general websites.

Hope this helps.

~Gioan

1 Like

Thanks for all the details Gioan. It would certainly need to be a specific implementation for consistently laid out content.

I’m curious what you mean about anchor references. I saw mentions of ‘anchor text’ in the index docs but wasn’t sure exactly what it refers to.

FYI I was thinking specifically about this page, which has many unrelated sections: