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

    (@msaari)

    Yes, it’s possible the whole link, including the anchor text, gets stripped from the body before the excerpt is made. I’ll have to check if that’s the case.

    Plugin Author Mikko Saari

    (@msaari)

    No quick and easy fix for this, I’m afraid.

    Plugin Author Mikko Saari

    (@msaari)

    I finally had a chance to test this, and in my tests the search terms in links are shown in excerpts as they should.

    I am getting the same issue, most excerpts contain the search term, but some do not. Example: http://www.heritagetraveller.com/?s=roman
    … 3rd and 7th results do not contain the search term. Also, you may notice that the character count is not the same on all excerpts.

    FIXED:
    For me the following was the issue. The excerpt length in the options exceeded the allowed length of excerpt stated in search.php… bring down the default length in the Relevanssi options and the search terms start to appear… got to experiment a bit to get it right. Also, be aware that any css added through the options (Highlighting or for Breakdown Format) will be included as characters/words in the excerpt length…

    Plugin Author Mikko Saari

    (@msaari)

    lso, be aware that any css added through the options (Highlighting or for Breakdown Format) will be included as characters/words in the excerpt length

    That is not correct, at least not for Relevanssi settings. Relevanssi creates the excerpt at correct length, then adds the highlighting code. If you have something that calculates excerpt length after that then yes, the highlight code will be included.

    I am no expert, I am simply telling you what happens. If I add additional css through the settings, then it adds it to number of characters.

    Here is the offending code in my search.php (I guess it is not WP default to limit the excerpt length?):

    <p>
    <?php echo substr(get_the_excerpt(), 0, 300); ?>
    <?php if(strlen(get_the_excerpt()) > 300) : ?>...<?php endif; ?>
    </p>

    I set the excerpt length here to much higher than in Relevanssi options, then no issues.

    Plugin Author Mikko Saari

    (@msaari)

    Yes, you’re counting the length of the excerpt with the code in it, yes. If you set Relevanssi excerpts to 300 characters, you get 300 characters + highlighting code.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: Relevanssi – A Better Search] Missing search terms from linked text in the excerpt’ is closed to new replies.