Continue reading Indexing image captions for the posts

Indexing image captions for the posts

The use case is I run several newspapers, and the “caption” field when uploading media is where the journalists put the photographer credit. We need to be able to index the photographer bylines, but ideally would want to return the story/commentary where their image was used, not the image itself. If you want to index…

Read more Indexing image captions for the posts 0 Comment on Indexing image captions for the posts
Continue reading Indexing embedded PDFs for the parent post

Indexing embedded PDFs for the parent post

Relevanssi can automatically index PDF content for the parent post, if the PDF (or other attachment) is attached to the parent post in WordPress. However, that’s not always the case. Sometimes the PDF is attached to the page using an embed, and that doesn’t create a connection between the posts in WordPress. Thus, Relevanssi won’t…

Read more Indexing embedded PDFs for the parent post 0 Comment on Indexing embedded PDFs for the parent post
Continue reading Indexing post slugs

Indexing post slugs

By default Relevanssi does not index the post slug. It is, however, an easy thing to fix using the relevanssi_content_to_index filter hook. This function will read the post slug, replace the hyphens with spaces (so that indexing-post-slugs becomes “indexing post slugs”) and add the slug to the post content. Just add this function to your…

Read more Indexing post slugs 0 Comment on Indexing post slugs
Continue reading Gmedia photo gallery tags

Gmedia photo gallery tags

Gmedia photo gallery gives a false impression of working with Relevanssi, as you can see the gmedia_tag taxonomy appear in the list of taxonomies: However, if you try to index those tags, you’ll soon notice Relevanssi isn’t actually indexing them. That’s because Gmedia gallery doesn’t use that taxonomy for the tags. The tags are actually…

Read more Gmedia photo gallery tags 0 Comment on Gmedia photo gallery tags
Continue reading Indexing ACF relationship content

Indexing ACF relationship content

If your posts include content from related posts using the Advanced Custom Fields relationship functionality, Relevanssi doesn’t index that content by default. Even if you set Relevanssi up to index the ACF fields, the relationship fields do not include any content, just references to other posts. Those, even if indexed, are not particularly helpful. ACF…

Read more Indexing ACF relationship content 0 Comment on Indexing ACF relationship content
Continue reading Indexing product variation SKUs for main product

Indexing product variation SKUs for main product

Relevanssi can index product and product variation SKUs for WooCommerce products: just add _sku to list of custom fields to index. However, if you want to find the main product when searching for the product variation SKU, you need some extra code. Just add this function to the theme functions.php and rebuild the index: add_filter(’relevanssi_content_to_index’,…

Read more Indexing product variation SKUs for main product 12 Comments on Indexing product variation SKUs for main product
Continue reading Advanced Custom Fields Relationship fields

Advanced Custom Fields Relationship fields

Update 16.1.2018: There’s a better post on this topic at Indexing ACF Relationship Content. I’m working on a website and i’m use A LOT the Relationship field au ACF. So on my pages are displayed informations of some related custom post. Is there a way to get that working in the search ? With some…

Read more Advanced Custom Fields Relationship fields 1 Comment on Advanced Custom Fields Relationship fields
Continue reading Indexing attachment filenames

Indexing attachment filenames

Relevanssi has been working nicely for the normal usecase. But how does one setup indexing of attachment files. When someone searches by filename or extension like pdf, there are no results. I have enabled ‘attachment’ at Relevanssi ‘Indexing options’ and still there are no results. Relevanssi doesn’t index attachment file names. For attachments, Relevanssi indexes…

Read more Indexing attachment filenames 0 Comment on Indexing attachment filenames
Continue reading Searching by post ID

Searching by post ID

Are post ID’s searchable in Relevanssi? No. Relevanssi does understand the WP_Query p parameter to restrict the search by post ID. However, if you want to search by post ID, it’s very simple to make that happen: add_filter(’relevanssi_content_to_index’, ‘rlv_index_post_id’, 10, 2); function rlv_index_post_id($content, $post) { $content .= " " . $post->ID; return $content; }add_filter(‘relevanssi_content_to_index’, ‘rlv_index_post_id’,…

Read more Searching by post ID 2 Comments on Searching by post ID