WPSolr logo
Search
Close this search box.

Table of contents :

WordPress search : Ultimate Guide for 2024

Wordpress search

Table of contents :

WordPress is the most widely used CMS and single handedly powers 40% of the web. If you haven’t tried it already, it is intuitive, powerful and if you use one of many hosting providers out there, you can easily set up a working website in minutes.

But once you made all of your content, how do you ensure that your users can find it. For that, you need a good site search. Many types of search exist : keyword search, AI search, even personalized search.

WordPress provides one by default, but it is incredibly slow and ineffective.

This guide will go over the benefits of a fast and relevant search and how you could implement third party search engines easily into any WordPress or Woocommerce website.

 

What are the benefits of a WordPress search ?

There are numerous benefits to having a fast and relevant search on your WordPress website.

Improve user experience

It has been proven that having a slow website will drastically increase bounce rates, which has great negative consequences on conversion rates. So website owners have consistently improved performance on their website in multiple ways. Paying for better and faster hardware, optimising media and code, using CDNs, etc…

There is no reason to not do the same for your website search. Having a fast search will improve user experience. Let an external search engine take control of your search so that you can free up some of your ressources on your WordPress server and deliver the results faster thanks to it’s retrieval optimized architecture.

But speed isn’t the only factor. Relevancy is crucial. Not only do you want the results to appear quicker, but they need to be as accurate, as relevant, as possible. Unappealing results can be just as discouraging to users as slow ones. Having a relevant website search will make sure that they find the piece of content they want fast so that this memorable experience will make them want to return in the future.

Improve content-discovery

There is no greater waste than producing interesting and informative content that no one will ever see. A good search experience on your website will allow you to avoid this problem.

Your users should be able to find precise information located in your pages, posts, or other WordPress data’s content. If more of your content is easily searchable then your catalogue will seem far greater. Conversely, if only a small amount of content is findable, it will seem as though you don’t have any at all.

Boost your e-commerce sales

Example of a search in Amazon (complete with Ajax search & facets)

Example of a search in Amazon (complete with Ajax search & facets)

Search is vital for e-commerce websites since in this industry conversions (sales) is the only thing that matters. If your visitors can’t find what they need, your business will inevitably go under.

Your product search needs to be fast, seamless to avoid frustration since every bounce is a potential sales lost.

An e-commerce website also needs more than simple search, it needs :

  • Ajax search : Ajax search, or live search, will make your website seem more interactive to your visitors since whenever they are typing in the search bar, suggestions will be displayed under it in real-time. It could be autocompletion (like in the Amazon example above) or it could suggest specific products.
  • Facets : There are many types of facets. Check boxes, radio boxes, date pickers, color pickers, etc… They are displayed in search interfaces so that the visitors can filter results based on specific criteria to further refine the search queries. In the Amazon example above, the “Google” box is checked so  that only phones that are of brand “Google” are returned.

Why not use the default WordPress search ?

The default WordPress search can only work for websites that don’t contain a lot of content and are low traffic. Learn why down below :

Default WordPress search : view SQL query using Query Monitor

Default WordPress search : view SQL query using Query Monitor

Slow and imprecise

This is because it works using SQL (as you can see above).

A simple relational database is not meant for informational retrieval since it doesn’t rank, it mainly filters. A good search not only needs to display the correct items, but it needs to display them in the right order (ranking) based on their relevancy to the query. So a SQL database, which cannot measure relevancy, cannot boost the most relevant products to the top of the search results.

The default search will also be slower since it shares the same ressources (server) as your WordPress. Having many users search will slow down the website. So having a external search engine take care of your search queries will not only allow you to have a more accurate search but it will also free up ressources for your WordPress.

Limited freedom

The default WordPress search doesn’t offer you much freedom. It doesn’t offer you any freedom at all actually.

It searches for all WordPress documents (pages, posts, products, etc…) so you can’t pick and choose the searchable content.

What are the common forms of search in websites ?

You can implement search in a few ways on your websites. Here are the three main ones :

Standard search page

 

The user has searched for hat in WordPress using WPSolr

The user has searched for “hat” in WordPress using WPSolr

This is a standard search. It works by loading a new page with the relevant results.

The page has been loaded using the default WordPress parameter “?s” used for search. When clicking enter in the search bar, the url has been changed to “https://www.mywebsite.com/?s=hat”. In this case, the search query is hat (since “?s=hat”), but whatever the value of the “s” parameter is will be used for the search query.

The appearance of the results will be defined by the WordPress theme in use.

Ajax live search

The visitor uses Ajax search to autocomplete their search query in a WordPress website using WPSolr

The visitor uses Ajax search to autocomplete their search query in a WordPress website using WPSolr

Ajax search, or live search, can be used to autocomplete queries or suggest items in real-time as the user is typing. As explained previously, this can make your website more modern and interactive since it gives instant feedback.

Faceted search

The visitor uses facets to filter their "hat" search results in a WordPress website using WPSolr

The visitor uses facets to filter their “hat” search results in a WordPress website using WPSolr

Facets are visual components found on search pages that allows users to filter their search results based on predefined criteria. This allows them to personalize the results to only view the content that they want to see.

Facets exist in many forms :

  • check boxes : this facet shows texts as a list of selectable items. They enable to select several items of the same facet. It can be used in two situations: the facet items are multivalued or a post can have several values for the attribute or custom value.
  • radio boxes : similar to check boxes, this facet show texts as a list of selectable items. However they prevent multi-selection of items.
  • date picker : this facet is a range selector to filter any post-type that contains a date field that appears between two user selected dates.
  • slider : a range slider can position a number within a range. A typical Range Slider usually can be used to filter results between two prices, or two dates.
  • color picker : rather than showing the texts of colours in a facet, why not show an image with the color as the background ? The idea is to associate colours to your field values, by picking a colour with a colour picker.
  • select box : This facet lets you choose the field you want to filter from a drop-down list.

How do search engines work ?

To accelerate and enhance your search, you should make use of search engines.

Search engines use document databases (non-relational) and will search for matching documents using inverted indexes.

While the WordPress default search loops through the “wp_posts” table that contains each post (or page, product, etc…) as a row and each row contains the post’s respective data (including post content), the search engine uses an inverted index : the inverted index stores each individual keywords (called terms, tokens) and links each one of them to documents that contain the term.

Diagram explaining how inverted indexes work.

Diagram explaining how inverted indexes work.

The inverted index is optimal for information retrieval since it avoids looping through a very long table containing all your posts. Instead, it will quickly locate relevant documents by directly referencing the terms in the index, significantly reducing search time and improving overall performance.

Now that you know how they work, you can discover the different types of search engines :

Keyword search

Keyword search engines index the content and then executes search queries by matching the keywords in the queries with the ones in the indexed documents.

The returned results ranking is then based on each document’s score : the ones with the top score (most relevant) will be placed at the top, the ones with the worst scores are placed at the bottom.

This is most simple and cost-effective type of search. It should get the job done out of the box but since it matches words together, it will require more fine-tuning to achieve perfect results for your use-case.

Semantic search

Semantic search works differently than keyword search since instead of storing text, it stores embeddings (vectors). It is a type of AI search.

It is useful because instead of simply matching the keywords, it will understand the meaning of the words and the sentences to return the most relevant results. It is also a form of multilingual search and is typo resistant.

Image search

Image search also uses AI (embeddings) and can recognize images. Image search can be image to image (return similar images) or text to image (return images based on a search query).

This type of search is becoming increasingly popular for e-commerce websites.

Learn how to add image search to your WordPress.

Personalized search

Personalized search uses AI to not only recommend relevant content but personalize the results based on each users behaviours and interests. Everytime a user does an action on the website (click on a post, add to cart, view a page, etc…) a user event is sent to the search engine so that it can be trained on this data to learn about each one of it’s users. This way the model can accurately predict what they will want to see or click on next.

This form of search can also be paired with AI/vector search.

Learn more about personalized search.

RAG

RAG is an acronym for Retrieval Augmented Generation. This means that whenever a user types a query, it will use a standard search to “retrieve” results but instead of directly displaying them to the user, the results will be fed to a text generation model and that generated text can then be displayed to the user.

RAG is useful for complex question answering since you can generate a response that you know is based on real data and information, reducing the likelihood of hallucinations or nonsensical outputs.

Learn more about RAG.

Which search engine should you choose ?

Now that you know how search engines work, you can discover some existing solutions :

Apache Solr logo

 

Apache Solr

Apache Solr is one of the oldest publicly available search engines today. It was created in 2004 and is based on the Apache Lucene library.

Solr as a search engine can provide keyword search and can also power facets. It is open-source so you could install it locally or access it through one of many cloud hosting providers.

If you want a highly scalable and enterprise grade search engine that is highly customizable, Apache Solr is the right fit for you.

If you are curious about Solr performance, you could check out our Woocommerce demo (2000 products).

Elasticsearch logo

Elasticsearch

Elasticsearch, also based on Apache Lucene like Solr, can also provide keyword search and power facets but differentiates itself by delivering more modern capabilities.

In recent years, it has become one of the more popular search solutions thanks to it’s great price to performance ratio. You could install it locally yourself or create your Elasticsearch instance in the official cloud platform.

Elasticsearch recently seems to be be bringing focus to machine learning and AI/vector search. By training your models and creating embeddings (vectors) from your data, you could set up semantic or image search for an even more accurate search.

You can easily add Elasticsearch to your WordPress website.

Opensearch logo

Opensearch

Opensearch is a recent fork of Elasticsearch that is available on the AWS platform. It offers many of the same features as Elasticsearch.

It too offers machine learning capabilities and you could install it locally or create an Opensearch instance in AWS.

If you are curious about Opensearch performance, you could check out our Woocommerce demo (100 000 products).

 

Algolia logo

Algolia

 

Algolia is a complete search and recommendations provider. It is a cloud provider only (you cannot install Algolia locally) and can be rather pricy for small businesses.

But whether it is keyword search, AI search (semantic and image search), personalized search or even recommendations, Algolia supplies everything you would need out of the box.

If you are curious about Algolia performance, you could check out our Woocommerce demo (2000 products).

Weaviate logo

Weaviate

 

Weaviate is exclusively a vector search engine. It is open-source so you could install it locally but they also offer cloud hosting.

Weaviate has countless official modules for you to choose from. You can even use these to load and use any Huggingface model for vectorizing or reranking.

With Weaviate you can have semantic search, reranking with cross-encoders, image search, and RAG (or questions and answers).

If you are curious about Weaviate performance,we have a few Weaviate + Woocommerce demos for you to try out.

Recombee logo

Recombee

Recombee is an AI personalization engine that is exclusively cloud hosted. It can provide personalized search and recommendations, and even personalized email.

It’s free tier offers most features (the major limiting factor are the usage limits) making it the best engine for small businesses.

Learn more about Recombee using our complete review.

If you are curious about Recombee performance, you could check out our Recombee recommendations + Woocommerce demos.

Google retail logo

Google Retail

Google Retail includes both Retail search & AI recommendations. Using this service you can add search & recommendations to your websites.

If you are curious about Google Retail search performance, you could check out our Woocommerce demo (2000 products).

vespa logo

Vespa

Vespa is an open-source search engine that powers Yahoo. It is incredibly complete since this enterprise grade search engine can deliver all types of search (keyword, vector & personalized) and even recommendations.

Integrate search into your WordPress website

Integrating a search engine into your WordPress & Woocommerce website can be a difficult task. But not to worry, WPSolr has you covered.

WPSolr is a search & recommendations plugin that can add all types of search into your WordPress or Woocommerce website : keyword search, semantic search, image search, personalization, RAG.

This is thanks to a wide range of compatible search engines (Apache Solr, Elasticsearch, Opensearch, Algolia, Weaviate, Recombee, Google Retail).

You can use these search engines to power your WordPress search, Ajax search, facets and even recommendations.

You could also check out our top WordPress search plugins for more options.

 

Conclusion

 

WordPress, powering 40% of the web, offers an intuitive and robust platform for website creation. However, ensuring users can easily find content on your WordPress site is crucial. This guide explores the benefits of implementing fast and relevant search engines, such as keyword search, AI search, and personalized search, into WordPress and WooCommerce websites. While the default WordPress search may suffice for low-traffic sites with minimal content, it lacks speed, precision, and customization options. By upgrading to third-party search engines, you can significantly enhance user experience, improve content discovery, and boost e-commerce sales. Additionally, features like Ajax search and facets provide real-time suggestions and filtering options, further enhancing the search experience. Leveraging search engines like Apache Solr, Elasticsearch, Opensearch, Algolia, Weaviate, Recombee, and Google Retail, WordPress users can seamlessly integrate advanced search functionalities into their websites. With the right search engine, you can ensure that users can easily locate relevant content, leading to increased engagement and satisfaction.

Related posts ... not powered by WPSOLR 😊

Algolia Recommend
WPSOLR will integrate with Algolia Recommend

WPSOLR will integrate Algolia Recommend https://www.algolia.com/products/recommendations/ as its first recommendation brick.   #algolia, being already part of the #searchengines supported by WPSOLR, is the most

Release 22.3 with Weaviate vector search

This is an exciting moment, where #vectorsearch is getting to the rich #wordpress and #woocommerce community: site and shop owners, agencies, or even specialised hosting