WooCommerce pack – Can I replace orders search with WPSOLR search ?

137 views November 4, 2016 December 14, 2016 wpsolr 1

Replace WooCommerce orders search with Solr search

Replace WooCommerce orders search with Solr search

 

Yes, from WPSOLR 14.5, you can.

How does it work ?

WooCommerce orders are built upon the WordPress post type “shop_order”. And, as you know, WPSOLR is able to index and search in any post type.

Just select the option “Replace WooCommerce orders search by WPSOLR’s orders search” in your WooCommerce pack, et voilà!

What are the benefits of replacing WooCommerce orders search ?

You gain all Apache Solr features, especially accuracy and performance.

You’ll need performance if you’re searching in the content of thousands, or tens of thousands, of orders. Usually, the search in orders meta information, like the order billing address, is performed with several SQL joins between tables ‘post’ and ‘post_meta’. Add to that  the SQL LIKE operator, to retrieve fields beginning or ending with some keywords, and your server is on his knees. But not with WPSOLR search.

Regarding the search accuracy, with Apache Solr you can benefit from:
– stopwords: the removal of small words like ‘the’, ‘a’, ‘from’
– stemming: get results for ‘coming’, ‘come’, ‘came’
– synonyms
– Language specific filters
– ….

Which order meta fields are indexed and searched ?

You select the order meta fields you need, in WPSOLR configuration.

woocommerce pack order meta fields

Select the order meta fields you need to search in

 

The orders search page looks the same, why ?

Because WPSOLR replaces the search in the background, but let WooCommerce display the results as usual.

You can sort by columns (ID, post_date, total order), and filter by order status, as usual too.

 

I get an error when sorting by column “Total”, why ?

Because “_order_total” custom field needs to be declared with a Solr type sortable. Just select “Number float ” as show below, and reindex all your orders!

order total field is a number

order total field is a number

Was this helpful?

Leave A Comment

*
*