• Resolved Rasso Hilber

    (@nonverbla)


    Hi there!

    I have a bit of a complicated scenario where some posts are acting as “mirrors” for other posts, displaying all of the fields of these mirrored posts in the frontend. The mirrored posts should be excluded from the search results (I already found a solution for that using post__not_in, and instead the posts acting as mirrors should show up. But they won’t because they don’t actually contain the requested search tokens.

    One idea I had was to add the full relevanssi index data from the mirrored posts to the post mirrors (very confusing, I know ??) on save_post. If this is the recommended solution, could you point me towards a clean way to do that? Or do you have a better idea? I’m a Relevanssi premium user.

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

    (@msaari)

    For starters, Relevanssi Premium support is here. Please use that, as that gets you the premium service you’re paying for.

    You have a good idea, but instead of save_post, use relevanssi_content_to_index, which exists for cases like this.

    Thread Starter Rasso Hilber

    (@nonverbla)

    Thanks for your response! I’ll make sure to open future tickets on the premium support. Hope it’s ok that we finalize this issue here, it might help someone else in the future.

    relevanssi_content_to_index looks interesting. Now the only question remains, how can I get the Relevanssi index data for a post (the data being displayed when clicking “How Relevanssi sees this post”)?

    Plugin Author Mikko Saari

    (@msaari)

    Take the original post content (or the relevant parts), and Relevanssi will then index it for that post. It’s easiest that way.

    Thread Starter Rasso Hilber

    (@nonverbla)

    Thanks Mikko! Resolved it manually syncing the meta values, that made Relevanssi pick them up for the mirrors as well.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Add custom text to index for certain posts’ is closed to new replies.