• Hi Mikko

    I like your plugin and hope you can help.

    I have a site with say 10 pages but with lots of content on each page
    When people search for something it brings up the whole page which is long.

    Is there a way to index h2 and h3 tags so that when people search for a word in those tags, the result will give at, the top of the page, the h2 tag and the content in that section, not just show the whole page

    thanks Steve

    • This topic was modified 8 years, 5 months ago by stevebro.
    • This topic was modified 8 years, 5 months ago by stevebro.
    • This topic was modified 8 years, 5 months ago by stevebro.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Mikko Saari

    (@msaari)

    First of all – it’s your theme that’s printing out the whole page, not Relevanssi.

    If you switch your theme to show excerpts and then enable custom excerpts in Relevanssi, Relevanssi will show a short, relevant part of the post in the results, matching the actual search terms.

    I’d suggest you try that first. That would be much, much easier to do. If you’re not happy with that, then you can try building something more complicated.

    This isn’t really about indexing. What you want here is something that would be the responsibility of the theme, not Relevanssi. It’s certainly possible to create an excerpting method that splits the post into sections and then figures out which section matches the search query the best – but that’s something you need to do in your theme.

    Thread Starter stevebro

    (@stevebro)

    Thanks Mikko
    I’ll check it out and get back to you

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘indexing h2 tags and displaying that section first’ is closed to new replies.