• Resolved Juan Hernando

    (@unintended8)


    Hi Mikko! Congratulations for the awesome plugin <3

    I have a website with some tables we’ve done using TablePress. For example, something like Column 1: Year, Column 2: Full Name. In the Relevanssi settings I have the expand shortcodes active and it works mostly well.

    But in the search results I can see that the ‘content’ (from the extract) of those expanded shortcodes look like: ‘1980Joe Doe 1981Jane Doe’. And so, if I search for ‘Doe’, there’s no problem, but if I search for ‘Joe’ I don’t get the desired result.

    Is this something normal? Can I modify it somehow? Thanks!

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

    (@msaari)

    It’s normal that the spaces between columns don’t show up in the excerpts. However, Relevanssi should still index the table contents correctly. If you look at the post with the Relevanssi debugger (Settings > Relevanssi > Debugging), is the table content indexed correctly? Does it say “1980Joe”, or “1980” and “Joe”?

    As for the excerpts, Relevanssi adds spaces after some HTML tags to avoid things like this when the tags are removed. <td> isn’t on that list, but it should be. I’ll fix that in the next version. Meanwhile, you can do

    add_filter( 'relevanssi_excerpt_content', function( $content ) {
        $content = preg_replace( '#</td>#i', ' ', $content );
        return $content;
    } );

    This will add some extra spaces to make things look nicer.

    Thread Starter Juan Hernando

    (@unintended8)

    Thanks Mikko! The code works perfect for the visual space that wasn’t there in the excerpts. I’ve seen the debugging tool and you’re right, each word is there separate. And now the doubt is a bit more complex then on what’s going on ??

    I can’t share the URL here (it’s still a work in progress) but let’s say that if I search for custom name of long element with many words I don’t get the result of the page with the table that has it. But if I search for name of long element with many words, it appears. It’s not a stopword, it’s just weird (and in the excerpt that first word was glued to the number of the column before, that’s why I thought that would be the reason).

    Do you have any clue about what can be going on? (I can send you more details in private if needed)

    Plugin Author Mikko Saari

    (@msaari)

    Too many variables here, can’t really say anything about this without more specific information. Do all the words you want to use to find the post appear in the post content when you look at the debugger?

    How many posts are involved? Are you throttling the search results? That can sometimes cause missing results when a post doesn’t fit in the top 500 results for a specific keyword.

    Thread Starter Juan Hernando

    (@unintended8)

    You’re right Mikko. The original question was related with the space in the excerpt and I didn’t think that we’ll need much more information, but in this case I will start debugging the whole query as you stated here https://www.relevanssi.com/knowledge-base/debugging-relevanssi-searching-issues/ and I’ll open a new support thread if I’m still stuck, with all the info needed.

    It seems that all the words are in the debugger and I’m not throttling the results, so I’ll keep looking for it ?? Thanks for your time!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘TablePress shortcode expanded but with columns content glued’ is closed to new replies.