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

# Deboost documents

> Push a selection of documents lower in the results while keeping them available to your users.

Out-of-stock products frustrate shoppers when they fill the first results, but removing them hurts too: users still search for them, and they come back in stock. The same applies to refurbished items, old article versions, or listings from sellers with poor ratings. Deboosting keeps these documents findable and moves them after the others.

One rule with a deboost action covers this, and no condition is needed if you want it to apply to every search.

## Set up from the Meilisearch Cloud dashboard

Open your project in the [Meilisearch Cloud dashboard](https://cloud.meilisearch.com), select the **Search rules** tab, and click **New rule**. The visual editor opens. For a walkthrough of the editor, see [Create your first rule](https://www.meilisearch.com/docs/capabilities/search_rules/create_your_first_rule.md).

Choose the index, here `products`. In the **Your rule** panel, keep **Anything** selected, so the rule applies to every search.

Hover any result card, click its deboost icon, then click **Choose a filter…**. Fill in the dialog:

* **Index**: the index holding the products, here `products`.
* **Strength**: how far the selected products drop. Start with **Medium**, then run a few searches of your own and adjust: the right strength depends on your data and on the way your users search.
* **Matching a filter**: the condition selecting the products, here `stock = 0`. The attribute you filter on must be in the [`filterableAttributes` setting](https://www.meilisearch.com/docs/reference/api/settings/get-filterableattributes) of the index, otherwise the action selects no document.

The dialog tells you how many documents the action affects. Click **Add action**.

![Deboost documents dialog with the index, the strength, the filter, and the number of documents it deboosts](https://mintcdn.com/meilisearch-6b28dec2/mjti93v8MIChJpXx/assets/images/cloud-search-rules/deboost-filter-dialog.png?fit=max\&auto=format\&n=mjti93v8MIChJpXx\&q=85\&s=dc7ee84b19313fccb70c056065f3d59c)

Click **Save rule**. In the **Review and save** dialog, name the rule, such as `out-of-stock-last`, then click **Save and activate**. Meilisearch indexes the rule, which can take a few seconds to a few minutes. Once it is live, out-of-stock products remain findable, but they lose ground to the products you can ship.

## Set up on a self-hosted instance

> [!WARNING]
>
> Turn on Search Rules before you call the `/dynamic-search-rules` routes, otherwise Meilisearch returns an error. See [Create your first rule](https://www.meilisearch.com/docs/capabilities/search_rules/create_your_first_rule.md#turn-on-search-rules-2).

```bash cURL theme={null}
curl \
  -X PATCH 'MEILISEARCH_URL/dynamic-search-rules/out-of-stock-last' \
  -H 'Authorization: Bearer API_KEY' \
  -H 'Content-Type: application/json' \
  --data-binary '{
    "description": "Show the out-of-stock products after the others",
    "active": true,
    "actions": {
      "scale": [
        {
          "indexUid": "products",
          "filter": "stock = 0",
          "weight": 0.5
        }
      ]
    }
  }'
```

* `weight` multiplies the relevancy of the selected documents. Between `0` and `1`, the documents rank lower. The closer to `0`, the further down they go.
* Deboosted documents stay in the results and in the facet counts. Only their position changes.
* A rule without `conditions` applies to every search on the index.
* The attributes used in `filter` must be in the [`filterableAttributes` setting](https://www.meilisearch.com/docs/reference/api/settings/get-filterableattributes) of the index, otherwise the action selects nothing.

Meilisearch answers with a summarized task containing a `taskUid`, because creating a rule is an [asynchronous operation](https://www.meilisearch.com/docs/capabilities/indexing/tasks_and_batches/async_operations.md):

```json theme={null}
{
  "taskUid": 43,
  "indexUid": ".meili_dsr",
  "status": "enqueued",
  "type": "dsrUpdate",
  "enqueuedAt": "2026-05-28T09:31:12.378140260Z"
}
```

The rule applies to searches once this task reaches the `succeeded` status. To follow its progress, pass the `taskUid` to the [task API](https://www.meilisearch.com/docs/reference/api/tasks/get-task.md).

From then on, out-of-stock products lose ground to the ones you can ship, and customers still find them. They do not always fall to the bottom: a product that matches the query much better than the others can still come first. Check a few typical searches and lower the weight if you want a stronger effect.

## Next steps

> [card] [Hide documents](https://www.meilisearch.com/docs/capabilities/search_rules/how_to/hide_documents.md)
>
> Remove documents from the results instead of lowering them

> [card] [Boost documents](https://www.meilisearch.com/docs/capabilities/search_rules/how_to/boost_documents.md)
>
> Rank a selection of documents higher

> [card] [Specific behaviors](https://www.meilisearch.com/docs/capabilities/search_rules/advanced/specific_behaviors.md)
>
> See how actions interact with filters and with each other

> [card] [API reference](https://www.meilisearch.com/docs/reference/api/search-rules/create-or-update-a-search-rule.md)
>
> Endpoints, rule fields, and update behavior


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.