---
title: Ranking
description: How Luigi's Box determines the order of search results using text relevance, business rules, and personalization.
slug: search/guides/ranking
docKind: guide
hub: search
---

Luigi's Box uses a complex ensemble of algorithms to determine the best order for search results. This process combines text relevance, business rules, personalization, and operational metrics.

:::note
**Deep dive**: For a comprehensive explanation of how ranking works, including visual examples and detailed logic, see the [Understanding search rankings](/quickstart/search/) quickstart guide.
:::

## Standard ranking hierarchy

The ranking model determines "Match Quality" based on several layers of signals, applied in this general order:

1. **Text match quality (Score)**: The foundation of ranking. Exact matches rank higher than fuzzy matches (typos) or partial matches.
2. **Availability**: In-stock items match higher than out-of-stock or "available soon" items.
3. **Business metrics (Learning to rank)**: Products with higher engagement (clicks, conversions) are promoted. This "feedback loop" ensures the most popular products float to the top.
4. **Personalization**: Results are re-ordered based on the individual user's preferences and history.

## Influence ranking

You can influence this automated process by providing additional data in your product feed.

### Margin

If you index a `margin` attribute, the system can prefer products with higher margins. This is a "signal" rather than a hard sort rule -- it nudges high-margin products up without destroying relevance.

### Freshness

To promote new arrivals, index the `introduced_at` timestamp. The **Freshness Ranker** boosts new products for a configurable period (e.g., 60 days), helping them gain visibility before they have accumulated historical performance data.

### Query-time boosting

You can also influence ranking dynamically with each API request using the `prefer` parameter (Soft Boosting). This allows you to boost products matching certain criteria for a specific query without filtering others out.

**Example:** Prefer "Nike" products for the current search.
`prefer[]=brand:Nike`

See [prefer[] parameter](/search/api/v2/search/) in the API reference.

## Manual control

For precise control, you can override algorithms using the [Luigi's Box App](https://app.luigisbox.com):

- **Booster**: Set permanent boost rules for specific products or brands.
- **Merchandising**: Pin products to specific positions for specific queries.
