The search system is where a bulk of the product recommendation happens on e-commerce sites, mobile shopping and payments apps.

As such, search needs to be an intelligent online sales force that optimizes both the long-term and short-term business metrics to increase sales and payment volume.

To do this effectively, e-commerce firms need a system that is both able to experiment in a limited capacity and learn from how consumers interact with search functionality of a site or a mobile app on an ongoing basis.

The system needs to first ensure that the intent underlying the consumer’s query is addressed by surfacing highly relevant results to encourage completing the sale and payment. However, when there is some leeway within highly relevant results, search should personalize the results to the specific consumer who issued the query.

Finally, when there are an adequate number of personalized and relevant results, the search system should optimize for business metrics that are currently important – for example margin rates or inventory levels for perishable or semi-perishable goods.

These business metrics could be department specific or category specific. For example, apparel may favor showing newer items (to introduce freshness to the consumer) or items that have lot of inventory (which may have to go on an end-of-season sale soon) while electronics may simply favor margins.

A good search system should make it easy for retailers to control this optimization process by enabling them to define the metric to be optimized at a department or a category level, while leaving the nuts-and-bolts of the optimization to be automated through the learning algorithms of the search system.

Suppose that a multi-category e-commerce site wants to optimize for margins in the “computer & electronics” category. For simplicity, lets also assume that consumers at this e-commerce site do not have a prior preference for big-ticket items such as computers – since individual consumers purchase them infrequently.

A consumer searching for a “windows notebook” at this e-commerce website may see the search system return models from HP, Lenovo, Dell, ASUS and Samsung, in order. Clearly all of these are relevant results for the consumer’s query. The key question, given that the e-commerce site is optimizing for margins in “computer & electronics” category, is – is the order of the results correct?

In the current week, it may be the case that the Samsung model affords the highest margin to the e-commerce firm. It should thus be promoted to the top slot for the “windows notebook” query. The e-commerce firm may thus tweak the search results such that the Samsung model does in fact take the top slot.

In doing the above tweaking the e-commerce firm may discover that the ASUS models’ margins are higher than HP, with Lenovo and Dell next. While the firm is massaging the results for the specific “windows notebook” query, it might take the initiative to order them by decreasing margin. Thus the final list becomes Samsung, ASUS, HP, Lenovo and Dell.

Next week, the e-commerce firm may get a specially negotiated low-price for the Lenovo model, pushing the margins from this model above that of Samsung. As a result, the ideal behavior of the search system on receiving the “windows notebook” query would be to show the models from Lenovo, Samsung, ASUS, HP and Dell, in order. And the search system may in fact display this sequence if the e-commerce firm undertakes yet another tweaking effort for this search query.

Clearly the optimizations mentioned above, based on fluctuating margins, are tedious to carry out manually. Such optimizations, if done manually for multiple search terms, are also expensive, consuming time from IT and merchandising experts. Finally, manual optimizations are error prone, so a search engine administrator may make a mistake that may go unobserved, leaking profits, for a significant period of time.

A modern day e-commerce search engine ought to be able to carry out optimizations against a metric, such as margin, for a specified category entirely on its own. Properly implemented and deployed, such a search solution would accurately calculate margin per slot and continuously auto-promote the products that have the best margins, amongst otherwise equivalent results.

The solution would retreat to a monitor mode, when the results for a search line up in decreasing order of margin and no new margin changing product catalog updates remain to be processed. The solution would awaken to carry out further optimizations when one or more of the product-catalog, user behavior or business metric being monitored change.

Srinivasan Seshadri is CEO of Zettata.