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’
– Language specific filters
Which order meta fields are indexed and searched ?
You select the order meta fields you need, in WPSOLR configuration.
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!