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

    (@msaari)

    If you look at the Atrar page with the Relevanssi debugger (Settings > Relevanssi > Debugging), what does it look like?

    In any case, Relevanssi does not in general index the attachment captions for the page they’re attached to. To guarantee this works the way you expect it to, I would recommend adding a relevanssi_content_to_index filter function that would read the attached image captions and add them to the collecties post content.

    Thread Starter silcro

    (@silcro)

    Hi Mikko,

    thanks for your quick reply.

    The Debugging doesn’t mention the word “White”. But I wonder why it works on the “groen” search?

    And if I also indexed attachments, this doesn’t change anything?

    Plugin Author Mikko Saari

    (@msaari)

    I don’t know why it works for “groen”. It shouldn’t, and may be picking it up from something else. Can’t really say, because I don’t know how your posts are built.

    You earlier did index the attachments, searching for “white” without the post type restriction found the attachment. No problems there. But if you want to find the parent post with the attachment caption, you do need the filter function on relevanssi_content_to_index, there’s no way getting around that, Relevanssi won’t pick up the attachment caption for the parent post otherwise (unless the caption is displayed on the parent page in a way that Relevanssi sees).

    Thread Starter silcro

    (@silcro)

    The captions are actually displayed on the parent page…

    I use metabox.io code and get the img caption values through the rwmb_meta(); function and echo them. Am I doing something wrong here so Relevanssi doesn’t pick it up?

    Plugin Author Mikko Saari

    (@msaari)

    Relevanssi only looks at the post content. If you’re using rwmb_meta() to print the values out in the template, Relevanssi sees nothing of that.

    Just add the filter function on relevanssi_content_to_index, that’s the way to solve this.

    Thread Starter silcro

    (@silcro)

    relevanssi_content_to_index did the trick, thank you very much for your help!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Not finding all img captions’ is closed to new replies.