What is the YITH WooCommerce Ajax Search add-on
This add-on allows you to use the YITH suggestions when searching with the WPSOLR search engine. It will however only work on the YITH WooCommerce product search widget. YITH WooCommerce Ajax Search add-on will show you suggestions when typing without having to configure them in WPSOLR.
Install the YITH WooCommerce Ajax Search plugin
Click on “Plugins” in the sidebar.
Then click on “Add New”.
Search for the yith woocommerce ajax search plugin.
Then click on “Install Now”.
Install the YITH WooCommerce Product Search widget
Click on customize on the front part of the website.
Then click on “Widgets” in the sidebar that appears.
And click on “Sidebar”.
Then click on “Add a Widget”.
And search for “YITH”. When you’ve added the widget, publish your changes.
Then search for something in the search box
You’ll see the newly added widget at the bottom of the first checkbox.
Create a WPSOLR index
Click on “Connect your indexes” in the WPSOLR section in the admin.
Then click on “Connect to your search server or search service”.
Choose a search engine and a hosting service. Select a language and give your index a name. Fill in the endpoint url you got from the hosting service. Leave the default number of shards and replicas if you’re not sure how many you need. Then fill in the user and password you got from the hosting service.
Activate the YITH WooCommerce Ajax Search add-on
Click on “Activate extensions” in the menu bar at the top.
Click on “YITH Ajax Search” in the sidebar.
Click on the first checkbox to activate the add-on. Then click on the second checkbox to use WPSOLR on the YITH WooCommerce Ajax search form widget in the background.
Then click on “Theme” in the sidebar.
Then select the first checkbox. This will activate the add-on. This is necessary if you want to have more options when customizing the search filters, like using a slider instead of a checkbox.
Configure WPSOLR
Click on “Define your search with” in the menu bar.
Click on the “Search” checkbox and choose the search engine index we created earlier.
Click on “Data” in the sidebar.
Then click on “Products” and choose the taxonomies you want.
Then choose the fields you want to use.
You can also change the field type. I selected the floating point number for the price field and the integer number for the stock field because i want to display them as sliders. A slider won’t work if the field is a text type. I left the default for the stock status field.
Click on “Filter” in the sidebar.
Then select the filters we chose before. When you’re done save.
Then stay on the page and change the label and layout of the price filter. Here I chose the range slider layout but you will not be able to choose this layout if you have not activated the “Theme” extension.
Then do the same thing for the stock filter.
Then scroll down to the stock status filter. I changed the label but left the default layout. Then scroll down.
Click on the “Override each item label” button.
Then fill in the facet value label. This will display the label you choose next to the checkbox on the front part of our website. When you’re done save.
If you want you can change the skin of the slider, although this option is only available after you saved. I chose the nice skin in this example.
Do the same for the stock filter.
Index your content
Click on “Send your data” in the menu bar.
Then click on the “Index selected post types in index” button to index your content.
Add the WPSOLR facet widget
Head to the front part of the website and click on customize.
Then click on “Widgets” in the sidebar.
Then click on “Sidebar”.
And select the “Add a widget” button.
Then search for “WPSOLR Facets”. When you’re done publish your changes.
Test WPSOLR search
We can now see what YITH suggestions look like. These suggestions are shown automatically without having to configure them in WPSOLR.
If you select a suggestion you should end up on a product.