Version 2.6 now available

June 17, 2015 , , ,

Version 2.6 of SearchWP is now available for all active license holders. You will see an update notification in your WordPress admin area, and the latest version is always available as a direct download from your Account. On to the wonderful release details!

Settings interface improvements

SearchWP got a bit of a facelift in the settings department. I’ve always liked the engine configuration, but the rest needed some work. Everything under the hood that powers the settings was reworked to better accommodate everything as well.

01-searchwp-settings-ui

These interface updates were influenced by CalderaWP projects and FacetWP because they’re awesome. The update affords more attention to the Advanced settings area which is becoming more of a utility as SearchWP and the user base matures. The Advanced settings area was also reworked to optimize actions most commonly taken on this screen. It also provides some very high level stats for the indexer that will help provide you details about the status as well as shed more insight should a support ticket need to be opened.

02-advanced-settings

The license management workflow has been completely reworked. When you have an inactive license (as in the screenshot above) the link will be called out in blue, with an active license it takes a step back and looks like the other tabs. The License management itself was redone to better call out the status of your license:

03-license-inactive

When your license is active, this page now indicates how long the license will remain active as well:

04-license-active

The ‘Support’ button has been reworked as a Help tab, allowing for a more streamlined ticket creation process with an easily accessible viewing of your System Information:

05-support

The last interface update was the integration of Extensions that require a settings UI. When one of those extensions is activated a new tab will be added and essentially replicate the dropdown that was present in versions prior to 2.6. Everything else extension-wise works the same on the surface, but an entirely new Settings API was built for extensions to integrate themselves into the settings. If you’d like to find out more about that, please see the Settings API documentation.

Introducing SWP_Query!

Perhaps the thing I am most excited about in SearchWP 2.6 is the introduction of a new class: SWP_Query. This class is something that will be most useful to developers, it aims to recreate as much as it can from WP_Query. WP_Query is essential for development, and many WordPress developers are very familiar with it. SearchWP can work in much the same way as WP_Query, so why not make a class that eases that process for developers? While SWP_Query will never fully replicate WP_Query, the aim is to have it be a utility that WordPress developers can use with as little friction as possible. As of SearchWP 2.6, SWP_Query supports the following arguments:

  • s — the search query
  • engine — the SearchWP engine to use (default: default)
  • posts_per_page — how many posts to return per page (default is the global posts per page defined in Settings > Reading in the WordPress admin)
  • nopaging — disable pagination and return all posts (default: false)
  • load_posts — whether to return post objects (default: true)
  • page — which page of results to return (default: 1)
  • post__in — array of post IDs to limit results to (default: empty array)
  • post__not_in — array of post IDs to exclude from results (default: empty array)
  • tax_query — see WP_Query‘s tax_query documentation
  • meta_query — see WP_Query‘s meta_query documentation
  • date_query — see WP_Query‘s date_query documentation

The introduction of SWP_Query should make the lives of many developers much better. SearchWP tightly integrates with WordPress’ posts table which makes something like this possible. I’m most excited about the tax_query, meta_query, and date_query arguments which will reduce the complexity of making those operations possible. Working with SWP_Query is very similar to using WP_Query:

<?php
$swp_query = new SWP_Query(
array(
's' => 'coffee', // search query
'engine' => 'default', // engine to use
'post_type' => array(), // override enabled post types in engine config (SearchWP 2.7+)
'posts_per_page' => 10, // posts per page
'nopaging' => false, // disable paging?
'fields' => 'all', // set to 'ids' to return only post IDs (SearchWP 2.7+)
'page' => 1, // which page of results
'post__in' => array(), // limit potential results pool to array of IDs
'post__not_in' => array(), // explicity exclude IDs from search results
'tax_query' => array( // tax_query support
array(
'taxonomy' => 'people',
'field' => 'slug',
'terms' => 'bob',
),
),
'meta_query' => array( // meta_query support
array(
'key' => 'age',
'value' => array( 3, 4 ),
'compare' => 'IN',
),
),
'date_query' => array( // date_query support
array(
'year' => 2015,
'month' => 6,
'day' => 1,
),
),
)
);
view raw gistfile1.php hosted with ❤ by GitHub

In the sample above, $swp_query will have a posts property (just like WP_Query) containing all of the search results. There are some other useful properties returned as well! For more information on SWP_Query please see the documentation.

Index improvements, new hooks, and bugfixes, enjoy!

Version 2.6 brings a reduction in overhead for the index which should improve performance both when indexing and searching. Another bug was fixed that in some cases prevented the indexer from completing when the remaining post(s) had no content to index after the content was tokenized. With all of the updates to the settings, a number of new hooks were added in version 2.6 as well. If you’d like to find out more, they are all documented.

I hope you enjoy SearchWP!

Full changelog:

2.6

  • [New] New class: SWP_Query which aims to mirror WP_Query in many ways, but with a SearchWP twist
  • [New] Settings UI has been revamped
  • [New] New filter: searchwp_swp_query_args to filter SWP_Query args at runtime
  • [New] New action: searchwp_settings_init fires when the settings utility has been initialized
  • [New] New action: searchwp_load fires when SearchWP has loaded
  • [New] New action: searchwp_settings_before_header fires before the settings header is output
  • [New] New action: searchwp_settings_nav_tab to implement settings tabs
  • [New] New action: searchwp_settings_after_header fires after the settings header is output
  • [New] New action: searchwp_settings_before\my_view where my_view is the name of the settings view for that tab
  • [New] New action: searchwp_settings_view\my_view where my_view is the name of the settings view for that tab
  • [New] New action: searchwp_settings_after\my_view where my_view is the name of the settings view for that tab
  • [New] New action: searchwp_settings_footer fires after each settings view has been displayed
  • [New] Results weights are included in HTML comment block when debugging is enabled
  • [New] New filter: searchwp_debug_append_weights_to_titles whether weights should be included in HTML comment block debug information
  • [New] New filter: searchwp_show_filter_conflict_notices whether filter conflicts should be shown when debugging is enabled (defaults to false)
  • [Improvement] Better license activation UX
  • [Improvement] Reduction of index overhead by way of pairing to engine settings
  • [Improvement] Refined list of default common (stop) words
  • [Fix] Clear out delta ceiling update check when waking up the indexer
  • [Fix] Fixed an issue that may have caused the indexer to loop when a post has no content to index after tokenizing/processing
  • [Fix] Fixed an issue where the settings screen spinner would not display
  • [Fix] Fixed an issue that prevented loading of some assets if the plugin directory was renamed
  • [Update] Updated translation files
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