Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Mikko Saari

    (@msaari)

    I suppose you can (though it would be somewhat tricky), but all those results would show the same excerpt, so that would not be particularly helpful. Relevanssi doesn’t know where the words are in the post, just how many times they appear, so Relevanssi doesn’t understand that the post has several different parts that would be relevant. Relevanssi sees posts as singular blocks.

    Thread Starter robthirlby

    (@robthirlby)

    Many thanks for your rapid response. I can see that each post can have only one Relevanssi excerpt. Would it be possible to append to that excerpt when a second and subsequent match is found in the post? I haven’t yet found where the excerpt is created but no doubt it will emerge from the PHP with a little more effort on my part.

    I am trying to deal with a long out of print book which is the history of the charity I am working for. It has no index so I am intending to put it up on our private website for members of the charity etc. to browse with a search engine, hopefully Relevanssi!

    Thread Starter robthirlby

    (@robthirlby)

    Silly me it is in relevanssi_create_excerpt in excerpt_highlights.php.

    Plugin Author Mikko Saari

    (@msaari)

    It is complicated. You could use the relevanssi_excerpt filter hook somehow, but that won’t help you to get the posts appear more than once in the results. And whenever you run the relevanssi_create_excerpt() for the same post and same keyword, you’ll get the same excerpt.

    Can you just split the book in smaller parts, so each post would cover a smaller part of the book?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘multiple hits in a post’ is closed to new replies.