Continue reading Related Posts

Related Posts

…option. You can also add taxonomies, like posts and categories. Using taxonomies requires that Relevanssi indexes the taxonomy; you can adjust that on the Relevanssi indexing settings page. You can choose which post types Relevanssi uses for the related posts. “Matching post type” means that for posts, Relevanssi uses posts……to use random posts or leave the related posts empty. Adding the related posts manually If you don’t want to append the related posts to the posts automatically, you can use the relevanssi_the_related_posts() function in your templates. The function will print out the related posts. If used without a parameter,……specify keywords that Relevanssi uses to fetch the related posts for that post. If you want a specific post to appear as a related post, you can list the post ID. The widget will also show the current list of related posts. Changing the settings should refresh the list right…

Read more Related Posts 0 Comment on Related Posts
Continue reading Index custom field contents

Index custom field contents

Custom fields (also known as post meta or meta fields) are a major part of WordPress the default search won’t search. That’s a big problem for people who use solutions like Advanced Custom Fields or Carbon Fields to develop sites: on sites developed with custom field plugins large parts of the post, content may be…

Read more Index custom field contents 50 Comments on Index custom field contents
Continue reading Indexing and searching PDFs in WordPress

Indexing and searching PDFs in WordPress

…attachment indexing is a two-step process. First, the attachment content is read and stored in a custom field (_relevanssi_pdf_content). This step alone does not index the attachment content – it just makes it available for future indexing and ensures you don’t have to read the attachment contents many times. The second……step is the actual indexing. Here Relevanssi offers two different methods. You can choose to index the attachment post type, in which case the search results will include the attachment posts. The other method is to index the attachment content for the parent post of the attachment, in which case…Relevanssi Premium users have asked for PDF indexing since day one, and version 2.0 finally introduced this feature. Coming up with a fast and reliable method hasn’t been easy, but we’re pretty proud of what we have now. Our PDF indexer doesn’t tax your server as it runs as a…

Read more Indexing and searching PDFs in WordPress 78 Comments on Indexing and searching PDFs in WordPress
Continue reading Taxonomy archive search

Taxonomy archive search

This is a Premium feature and only applies when you index taxonomy terms. This does not apply in free Relevanssi. To include taxonomy pages (categories, tags, custom taxonomies) in the search, enable the option on the options page. There’s also the option to choose which taxonomies are included. By default……the post object created from the taxonomy page, $post->post_title contains the name of the taxonomy, $post->post_content has the description, $post->link has the permalink and $post->post_type will contain the name of the taxonomy. If you want to modify the post objects Relevanssi creates from the taxonomies, you can use the relevanssi_taxonomy_term_to_post filter….…empty terms (not linked to any posts) are excluded from the index. If you want to modify that, see relevanssi_hide_empty_terms. What is indexed? Currently, the title of the taxonomy is indexed with the description field. Indexing the other fields isn’t currently possible. Taxonomy pages should be automatically updated in the…

Read more Taxonomy archive search 49 Comments on Taxonomy archive search
Continue reading Multisite searches

Multisite searches

Multisite search only works in Relevanssi Premium. Free Relevanssi can be installed in multisite environments, but it cannot search across sites. Relevanssi Premium can only support multisite searching across sites in the same multisite network. Relevanssi can’t search across multiple sites that are not in the same multisite installation. Cloud-based……searches, you need to adjust search forms to include a specific parameter that will enable the multisite searching. See “Changes to the search form” below. Changes to search results templates The search results templates require some changes, otherwise, the permalinks will be wrong. Inside the while (have_posts()) loop, add as……to what multisite searching can do. There’s limited access to search parameters. You can use post_type, operator, meta_query, include_attachments and orderby. Taxonomy terms from subsites can cause problems. Searching for taxonomy terms in taxonomies that exist in the current site works: for example searching for categories from different sites works,…

Read more Multisite searches 144 Comments on Multisite searches
Continue reading Direct access to the query engine

Direct access to the query engine

Relevanssi can’t be used in any situation, because it checks the presence of search with the is_search() function. This causes some unfortunate limitations and reduces the general usability of the plugin. You can, however, access the query engine directly. There’s a function called relevanssi_do_query(), which can be used to do search queries just about anywhere. Here’s a…

Read more Direct access to the query engine 61 Comments on Direct access to the query engine