Continue reading Premium 2.4.2 / Free 4.3.3

Premium 2.4.2 / Free 4.3.3

Premium 2.4.2 and free 4.3.3 are maintenance updates that don’t add much new, but fix issues and add general improvements – the project to take Relevanssi to 100% testing coverage proceeds and continues to produce improvements to the code. New features New filter hook relevanssi_indexing_adjust can be used to stop…

Read more Premium 2.4.2 / Free 4.3.3 0 Comment on Premium 2.4.2 / Free 4.3.3
Continue reading Natural-language date queries

Natural-language date queries

…= date( ‘d’, $time ); $date_query = array( ‘month’ => $month, ‘day’ => $day, ); if ( $use_year ) { $date_query[‘year’] = $year; } $query->set( ‘date_query’, $date_query ); $query->query_vars[‘s’] = ”; } return $query; } The solution is simple. The search query ($query->query_vars[‘s’]) is fed to PHP’s strtotime() function, which……converts an English-language string to a timestamp. If the search query converts to a timestamp, the timestamp is converted into a date and used for a date query. The function also checks if the year appears in the query. If it doesn’t, the year isn’t used. Yearless dates are converted…I just wanted to be able to type in a date on the search and for the search to come up with all the blog posts for that date. This is one of those tasks that sounds really simple, but is actually complicated. However, this question piqued my interest and…

Read more Natural-language date queries 17 Comments on Natural-language date queries
Continue reading Premium 2.4.1 / Free 4.3.2

Premium 2.4.1 / Free 4.3.2

Premium 2.4.1 and free 4.3.2 are maintenance updates that don’t add much new, but fix issues and add general improvements – the project to take Relevanssi to 100% testing coverage proceeds and continues to produce improvements to the code. New features SEOPress support, posts marked “noindex” in SEOPress are no…

Read more Premium 2.4.1 / Free 4.3.2 0 Comment on Premium 2.4.1 / Free 4.3.2
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 Premium 2.4.0 / Free 4.3.0

Premium 2.4.0 / Free 4.3.0

…you can hide them with CSS if you want to. The numbering of results also makes more sense. The date parameters (year, monthnum, w, day, hour, minute, second, m) are now supported. Premium only: You can now set a month restriction to show only recent posts in the related posts….…For more fine-grained date control, use the relevanssi_related_args filter hook. Premium only: Instead of fully random posts, you can choose to get random posts from the same category if no proper matches are found for related posts. Support for Paid Membership Pro added. WordPress SEO support, posts marked “noindex” in……WordPress SEO are no longer indexed by Relevanssi by default. Filter hooks Premium only: relevanssi_file_content filters the file content before it’s saved in the _relevanssi_pdf_content custom field. Premium only: relevanssi_related_args filters the related posts search arguments. relevanssi_indexing_limit filters the default number of posts to index (10). If you have issues…

Read more Premium 2.4.0 / Free 4.3.0 2 Comments on Premium 2.4.0 / Free 4.3.0
Continue reading Searching Bible verses

Searching Bible verses

A surprisingly common problem with Relevanssi is Bible verses. All that meaningful punctuation and single digits make exact matching of Bible verses really difficult for Relevanssi, and when searching for Bible verses, exact results are what matters – hitting something similar is generally not very helpful. There’s an easy solution, though: use phrases. Wrapping the verse…

Read more Searching Bible verses 1 Comment on Searching Bible verses
Continue reading Events Calendar: Remove past events from search

Events Calendar: Remove past events from search

…is to do both. Blocking the events in indexing with relevanssi_indexing_restriction will keep the index lean and blocking the events in searching with relevanssi_post_ok will make sure past events will be removed immediately from the search results. These instructions apply to The Events Calendar plugin, which stores the event end……= false; } } return $status; } /** * Removes past events from indexing. * * @param array $restriction The MySQL restriction and an explanation. * * @return array The restriction set with event restriction included. */ function rlv_exclude_past_events( $restriction ) { global $wpdb; $restriction[‘mysql’] .= ” AND post.ID NOT…

Read more Events Calendar: Remove past events from search 6 Comments on Events Calendar: Remove past events from search
Continue reading Premium 2.3.0 / Free 4.2.0

Premium 2.3.0 / Free 4.2.0

As suggested by the version numbering, versions 2.3.0 and 4.2.0 are major updates that change some of Relevanssi behaviour. Nothing should break, however, so updating from earlier versions is safe. There are lots of changes in this version, so now – and in future release notes – let’s look at…

Read more Premium 2.3.0 / Free 4.2.0 3 Comments on Premium 2.3.0 / Free 4.2.0
Continue reading Premium 2.2.5 / Free 4.1.4

Premium 2.2.5 / Free 4.1.4

Version 2.2.5 is a maintenance version that doesn’t introduce new features (except a couple of new filters) but fixes various problems. The biggest problem fixed is the case of multiplying post meta keys, which could happen when saving posts in Gutenberg. This new version will fix that: when a post…

Read more Premium 2.2.5 / Free 4.1.4 0 Comment on Premium 2.2.5 / Free 4.1.4