SearchWP News

Category: Announcements

SearchWP 2.9 brings a completely revamped settings UI. The interface updates also afforded the ability to make optimizations in other areas as well. This article aims to outline what’s new!

The settings UI continues on the premise that there is a Default search engine used for native WordPress searches. Along with the Default engine any number of supplemental engines can be created. All engines share the same configuration options, the only difference being that supplemental engines have a label so you can differentiate them.

ūüö® The Panic Button

Updating to SearchWP 2.9 did NOT alter your settings or your index

Please note that simply updating to SearchWP 2.9 has not made any changes to your existing settings nor has it altered your index in any way. The biggest change you’ll see is that your Weights look relatively “low” ‚ÄĒ because they are. There’s a new default weighting scale, and the old default weights were lower across the board than the new weights. You’re welcome to update your weights if you’d like but you do not have to!

A hook as been implemented that allows you to revert back to the pre-2.9 settings UI. To use the legacy UI simply add this hook to your theme’s functions.php and reload the page:

add_filter( 'searchwp_legacy_settings_ui', '__return_true' );

You can also add this hook to prevent the engine rules from being applied to the index, which was also added in 2.9:

add_filter( 'searchwp_indexer_apply_engines_rules', '__return_false' );

Note: By nature, the legacy UI will be missing some of the other improvements made to SearchWP 2.9

Enabling Post Types

There was some understandable confusion about the checkboxes over time, especially when it came to saving engines and subsequently making additional tweaks. When the settings screen reloaded, the top post type was given focus (as opposed to the post type you were working with prior to saving) which caused some headaches for customers.

Controls to add and remove post types from an engine

Gone are checkboxes to enable/disable post types in favor of a new approach entirely: if a post type is listed within an engine configuration it will be included in results. If a post type is not listed within an engine configuration it will not be included in results.

Sliders for Weights

Another point of confusion over the past few years has been the numeric value for assigned Weights. To improve the experience of working with Weight adjustments, you can now simply interact with the available slider instead of having to enter in a numeric value. When sliding, a tooltip is shown to provide a bit more context:

Using the Weight slider

By default the maximum weight is 100, so if you haven’t customized your weights since installing SearchWP your sliders may all sit at the low end of the scale. This is perfectly fine! The underlying implementation of the weighting system is still exactly the same, so you can continue using your settings as-is.

If you have customized your weights and have used a weight higher than 100, there is a new hook available to set the maximum weight for the sliders: searchwp_weight_max

Post type rules

Each post type has a set of rules that allow you to refine both what is excluded from the index as well as what the index is limited to. Exclusions were always available in SearchWP but prior to version 2.9 the exclusions applied only to the search algorithm. This made management of engine settings more straightforward, but it also meant that the index could have content that did nothing but take up extra space.

As of SearchWP 2.9 post type rules directly apply to the indexing process in addition to the search algorithm. This means that if you’re making use of post type rules your search results might have a free optimization waiting should you decide to rebuild your index. As the indexer runs, it checks the rules you have in place for all engines and indexes only the bare minimum so as to keep the index itself as lean as possible.

That’s not all! Prior to SearchWP 2.9 you could only exclude content, but now you can also limit to content as well!

As of SearchWP 2.9 you can also limit to certain taxonomy terms

These rules now apply to both the indexing process and the search algorithm. As a result, SearchWP will let you know when your index should be rebuilt so as to inherit the optimizations put in place by your engine(s)

Rebuilding the index now takes place in real time without leaving the settings screen, so you can keep your eye on it if you’d like! ūü§ď

Other details

All of the other underlying concepts of SearchWP remain the same in version 2.9 but the updates to the settings interface will hopefully squash any confusion when it comes to getting things¬†just right. While there’s a lot to see in the new UI I hope the low level behind-the-scenes updates are a welcome addition too!

SearchWP’s integration Extension for WP Job Manager has been updated to version 1.5.8. It brings an important compatibility update which is recommended for all SearchWP license holders.

Full changelog:

  • [Fix] Compatibility fix for WP Job Manager
  • [Update] Updated updater

SearchWP version 2.8.8 is now available to all active license holders. It is a recommended update with a number of bug fixes and some other improvements that will positively affect how SearchWP runs for you.

Full changelog:

  • [New] New filter searchwp_pre_set_post allowing for filtration of each post object prior to indexing
  • [Fix] Better interoperation with Widgets
  • [Fix] Prevent double search logs in certain cases
  • [Fix] Properly cancel native search SQL when performing admin search (props Jim)
  • [Fix] Repaired application of ‘Remove all traces’ feature on Advanced settings page
  • [Fix] Fixed an issue where incorrect total results counts were logged
  • [Improvement] PHP Warning cleanup
  • [Improvement] Better accommodation for customization during import routines
  • [Improvement] Better accommodation of engine configuration and exclusions when performing AND logic pass
  • [Change] Update to SWP_Query: post__in and post__not_in parameters are now explicit (previously behaved like hooks)
  • [Update] Updated updater

A new Pro Extension has been released: Related. You can now use SearchWP to power a related content system on your site!

SearchWP knows¬†a lot about the content on your site. Showing visitors related content can help extend their stay by exposing entries related to the one currently on display. If you’re currently using another related content solution, this extension can also lighten the load on your server by reducing the overhead of maintaining a separate related content index, or running heavy database queries at runtime.

Like SearchWP itself and its other extensions, Related was built with developers in mind. It’s as much a customizable system as it is a turnkey solution.

By default Related doesn’t do anything, but you can opt in to having Related automatically append related entries (per post type) on its¬†settings screen (accessed via the Extensions dropdown on the SearchWP settings screen):

Once that’s in place, Related will show up to 3 related entries to the current entry:

Related ships with an auto append default template¬†designed to fit in well¬†with your theme, but that’s not enough. There is a full template loader built in, allowing you to easily completely customize the look and feel of your related content.

The template loader is great because it allows you to completely specify the markup and style used for your Related content without having to muck with hooks or dequeueing assets or behavior that’s getting in your way.

If auto appending isn’t your style, you can programmatically utilize Related to find related content, and do what you want with it! It’s as easy as:

* Programmatically find Related content from SearchWP Related
// Instantiate SearchWP Related
$searchwp_related = new SearchWP_Related();
// Use the keywords as defined in the SearchWP Related meta box
$keywords = get_post_meta( get_the_ID(), $searchwp_related->meta_key, true );
$args = array(
's' => $keywords, // The stored keywords to use
'engine' => 'default', // the SearchWP engine to use
'posts_per_page' => 3, // how many entries to find
// Retrieve Related content for the current post
$related_content = $searchwp_related->get( $args );
// Returns an array of Post objects for you to loop through
print_r( $related_content );
view raw functions.php hosted with ❤ by GitHub

The last bit of detail that comes to working with related content is specifying how that related content is found. SearchWP is a powerful, keyword based search index for your WordPress site. A keyword-based system for finding related content makes perfect sense. When editing entries on your site, you can easily define what keywords are used to find Related content:

By default, Related will build a fallback set of keywords to use based on the title of your entries. This saves you some time when first activating Related, so you don’t have to edit every single entry on your site to determine a keyword set to use. Keywords can be updated at any time.

Related is¬†a powerful¬†related content solution, making use of SearchWP’s optimized index to find related content in real time without over-utilizing your server. Enjoy!

WooCommerce Integration 1.1.12 has just been released and is a recommended update for all active license holders. This is a quick bugfix release that resolves an issue concerning WooCommerce Layered Navigation Widgets in WooCommerce 3.0.

Full changelog:

  • [Fix] Fixed an issue that may have prevented proper results from showing when using WooCommerce Layered Navigation Widgets

WooCommerce Integration has been updated to version 1.1.11 and is a recommended update for all active license holders. It’s a maintenance release that includes fixes for Product visibility settings and other small improvements.

Full changelog:

  • [New] New filter searchwp_woocommerce_forced to force WooCommerce Integration to apply
  • [Improved] Better consideration of product visibility
  • [Improved] Better handling of redundant filter calls
  • [Update] Updated updater

SearchWP Live Ajax Search version 1.2.0 has been made available. This is¬†primarily an organizational release but it also fixes a couple of small bugs. It’s a recommended update for all extension users and is available for everyone:¬†

Full changelog:

  • Reworked build process to be more straightforward
  • Support script debugging (props mgratch)
  • Remove form action requirement to better integrate with other code (props mgratch)
  • Fixed an issue that prevented search from firing when re-entered too fast (props pierrestoffe)
Fix keyword search on your site. No coding required!

Now you can utilize all of the content that's gone unrecognized by native WordPress keyword search instantly with SearchWP

Get SearchWP