<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/boosting-search-by-stock-qsvj0nusw" -->

---
title: Boosting Search by Stock | daily.dev
description: An e-commerce search ranking problem is solved by boosting listings based on expected days of stock rather than raw unit counts. Since the same stock count can...
canonical: https://daily.dev/posts/boosting-search-by-stock-qsvj0nusw
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Boosting Search by Stock | daily.dev
og:description: An e-commerce search ranking problem is solved by boosting listings based on expected days of stock rather than raw unit counts. Since the same stock count can...
og:url: https://daily.dev/posts/boosting-search-by-stock-qsvj0nusw
og:image: https://api.daily.dev/og/posts/qSVJ0NUSW.png
og:image:alt: Boosting Search by Stock
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Boosting Search by Stock

**[Medium](https://daily.dev/sources/medium_js)** · 5 min read · 0 upvotes · 0 comments

## Summary

An e-commerce search ranking problem is solved by boosting listings based on expected days of stock rather than raw unit counts. Since the same stock count can mean very different urgency depending on sales velocity, the proposed formula divides total stock by a blended sales rate (weighted between the item's own history and its category's top-seller average) to get expected_days_of_stock. That value feeds a boost multiplier with a tunable ceiling (K) and a half-life parameter controlling how quickly the boost ramps up, letting well-stocked items rank higher without penalizing low-stock items below their base relevance.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://medium.com/@oleber_62556/boosting-search-by-stock-380ba199abc6>

## Questions this post answers

### How do you rank e-commerce search results by stock level without penalizing low-inventory items unfairly?

Convert raw stock counts into expected days of stock (total stock divided by a blended sales rate) and use that to compute a multiplicative boost, not a penalty. The formula boost = 1 + K * expected_days_of_stock / (expected_days_of_stock + half_life) means an out-of-stock-soon item just gets no bonus, while a well-stocked item earns up to a K-sized lift, keeping items from ranking below their base relevance score.

_daily.dev surfaces engineering writeups like this for teams tuning search ranking around inventory signals._

### How do you estimate an item's daily sales rate for a new product listing with little sales history?

Blend the item's own average daily sales (M) with the category's top-seller average daily sales (N) using a weight a that grows with how much history exists: a = days_available_last_30 / 30. A brand-new listing with only 3 selling days gets a=0.1, leaning mostly on the category benchmark, while a listing available all 30 days trusts its own sales rate entirely.

_engineers weighing item-level versus category-level demand signals can track approaches like this on daily.dev._

## Similar posts on daily.dev

- [A Big Win from a Small Search UI Change and a Predictive Model](https://daily.dev/posts/a-big-win-from-a-small-search-ui-change-and-a-predictive-model-badmu87qy) · Medium · 0 upvotes · 0 comments
- [I Stole a Wall Street Trick to Solve a Google Trends Data Problem](https://daily.dev/posts/i-stole-a-wall-street-trick-to-solve-a-google-trends-data-problem-yx78nq3mb) · Towards Data Science · 0 upvotes · 0 comments
- [Instamart’s Generative AI Forecasting: Scaling from Flat Forecasts to Deep Hierarchies](https://daily.dev/posts/instamart-s-generative-ai-forecasting-scaling-from-flat-forecasts-to-deep-hierarchies-sm44pwri5) · Swiggy Bytes · 2 upvotes · 0 comments
- [Forecasting Demand for New Products](https://daily.dev/posts/forecasting-demand-for-new-products-h7wv8g9ow) · Medium · 0 upvotes · 0 comments
- [How to quickly estimate the revenue impact of new product ideas](https://daily.dev/posts/how-to-quickly-estimate-the-revenue-impact-of-new-product-ideas-pmbdatxzc) · LogRocket · 1 upvotes · 0 comments

---

Tags: [#ecommerce](https://daily.dev/tags/ecommerce), [#recommendation-systems](https://daily.dev/tags/recommendation-systems)

[View this post on daily.dev](https://daily.dev/posts/boosting-search-by-stock-qsvj0nusw)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Boosting Search by Stock","url":"https://daily.dev/posts/boosting-search-by-stock-qsvj0nusw","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/boosting-search-by-stock-qsvj0nusw"},"datePublished":"2026-09-15T17:17:42.079Z","dateModified":"2026-09-15T17:34:07.472Z","description":"An e-commerce search ranking problem is solved by boosting listings based on expected days of stock rather than raw unit counts. Since the same stock count can...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/3e439e889d3cb3a3d80f70b33f45ae53?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/3e439e889d3cb3a3d80f70b33f45ae53?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Medium","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Medium","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/medium","url":"https://daily.dev/sources/medium_js"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/boosting-search-by-stock-qsvj0nusw","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"ecommerce,recommendation-systems","timeRequired":"PT5M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Medium","item":"https://daily.dev/sources/medium_js"},{"@type":"ListItem","position":3,"name":"Boosting Search by Stock"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/boosting-search-by-stock-qsvj0nusw#faq","mainEntity":[{"@type":"Question","name":"How do you rank e-commerce search results by stock level without penalizing low-inventory items unfairly?","acceptedAnswer":{"@type":"Answer","text":"Convert raw stock counts into expected days of stock (total stock divided by a blended sales rate) and use that to compute a multiplicative boost, not a penalty. The formula boost = 1 + K * expected_days_of_stock / (expected_days_of_stock + half_life) means an out-of-stock-soon item just gets no bonus, while a well-stocked item earns up to a K-sized lift, keeping items from ranking below their base relevance score. daily.dev surfaces engineering writeups like this for teams tuning search ranking around inventory signals."}},{"@type":"Question","name":"How do you estimate an item's daily sales rate for a new product listing with little sales history?","acceptedAnswer":{"@type":"Answer","text":"Blend the item's own average daily sales (M) with the category's top-seller average daily sales (N) using a weight a that grows with how much history exists: a = days_available_last_30 / 30. A brand-new listing with only 3 selling days gets a=0.1, leaning mostly on the category benchmark, while a listing available all 30 days trusts its own sales rate entirely. engineers weighing item-level versus category-level demand signals can track approaches like this on daily.dev."}}]}
```

