Let's take a look at how to load test your on-site search and improve performance.
Most online shoppers prefer to use site search, but many ecommerce brands treat it as an afterthought.
The most popular on-site search engine is Elasticsearch, which is based on Apache Lucerne. While installing Elasticsearch is beyond the scope of this article, the easiest way to get started is with a platform-as-a-service provider like Heroku, which provides Elasticsearch as an add-on that's complete with the Elastic Cloud control panel.
Elasticsearch Option in Magento – Source: Magento
Elasticsearch is also easy to integrate with the most popular shopping carts. For example, Magento enables Elasticsearch by default and makes it easy to index product catalogs on a regular basis to improve search results. Other proprietary ecommerce platforms also support custom Elasticsearch integrations that could improve on-site search performance.
There are several tips to keep in mind when implementing on-site search into an ecommerce shop to maximize conversion:
- Visibility: Search boxes should be easily seen and open to maximize usage (e.g. don't use a small magnifying glass that's barely noticeable).
- Autocomplete: Helps cut down on spelling mistakes and other user errors that could result in inaccurate search queries.
- Alternatives: Show potentially-related products if no matches are found rather than show no search results at all.
- Analytics: Revisit your search data often to see what’s trending and how you can improve search results. You may even reorder products in search results by profitability.
Many of these best practices are implemented on popular ecommerce websites, like Amazon, which provide a good baseline for your own implementations.
Load Testing Search
Elasticsearch operates through a REST API, which means that you can load test it like any other API. Using tools like JMeter, you can run a simple GET request against a search endpoint. This lets you verify that the response returns quickly and contains appropriate products. You may also want to test malformed queries and evaluate responses.
A protocol-based approach to load testing Elasticsearch confirms that the search API is working, but it doesn't test the actual end-user experience. Instead, you may want to run load tests in a real browser instance. You can see how quickly the results load from the API into your application, and that they display properly.
LoadNinja's Test Recorder – Source: LoadNinja
LoadNinja does exactly this. It makes it easy to build load tests in a browser – no scripting needed – and run them across thousands of real browser instances to get a true picture of performance. You can simply run through a search query in the test recorder, and the auto-generated test script will automatically hit the Elasticsearch server and generate the load.
In addition, LoadNinja supports dynamic tests using databanks. You can quickly define multiple search queries to run in the same test script without creating separate ones. That way, you can check things like misspellings or synonyms with no extra effort. It helps ensure a consistent user experience.
LoadNinja's DataBank Capabilities – Source: LoadNinja
If any errors occur, you can easily drill down into navigation timings and virtual user session DOMs. Determine the bottlenecks and implement a fix before the code even reaches production. You can also easily incorporate these load tests into a continuous integration environment to run after each commit or merge.
LoadNinja makes it easy to integrate load tests into your development cycle with minimal effort and identify performance bottlenecks early. That way, you can minimize the delays that typically occur with a last-minute performance test and QA.
Search Performance Tips
There are several ways to improve performance when using Elasticsearch and other on-site search engines. While the actual implementation of these optimizations is beyond the scope of this article, there are several basic concepts that apply to most cases. (Note: some may already be made by default.)
Common strategies for optimizing search performance include:
- Faster hardware: The clearest path is to improve hardware. For instance, using SSDs versus HDDs and increasing cache memory will go a long way.
- Auto-generated IDs: Search engines must check if a document with the same ID already exists, which is a costly operation over time. Using auto-generated IDs avoids this problem and speeds up indexing.
- Bulk requests: Bulk requests offer much better performance than single-document index requests – although too many bulk requests can cause memory issues when they're concurrent.
- Multiple workers: Multiple threads or processes can help improve search performance by making better use of resources and reducing the cost of each operation.
The Search Is Over
On-site search is one of the most commonly used features on ecommerce websites. But many brands treat it as an afterthought. The good news is that advanced search solutions are easy to implement. (Although be sure to optimize performance to meet end-user expectations.)
LoadNinja makes it easy to load test search functionality and other ecommerce elements without complex scripting, in realistic browser environments.
Sign up for a free trial to get started today!