Skip to main content
GET
/
dynamic-search-rules
/
{uid}
Get a dynamic search rule
curl --request GET \
  --url http://localhost:7700/dynamic-search-rules/{uid} \
  --header 'Authorization: Bearer <token>'
{
  "uid": "black-friday",
  "description": "Black Friday 2025 rules",
  "priority": 10,
  "active": true,
  "conditions": [
    {
      "scope": "query",
      "isEmpty": true
    },
    {
      "scope": "time",
      "start": "2025-11-28T00:00:00Z",
      "end": "2025-11-28T23:59:59Z"
    }
  ],
  "actions": [
    {
      "selector": {
        "indexUid": "products",
        "id": "123"
      },
      "action": {
        "type": "pin",
        "position": 1
      }
    }
  ]
}

Authorizations

Authorization
string
header
required

An API key is a token that you provide when making API calls. Read more about how to secure your project.

Include the API key to the Authorization header, for instance:

-H 'Authorization: Bearer 6436fc5237b0d6e0d64253fbaac21d135012ecf1'

If you use a SDK, ensure you instantiate the client with the API key, for instance with JS SDK:

const client = new MeiliSearch({
host: 'MEILISEARCH_URL',
apiKey: '6436fc5237b0d6e0d64253fbaac21d135012ecf1'
});

Path Parameters

uid
string
required

Unique identifier of the dynamic search rule.

Response

Dynamic search rule returned.

uid
string
required

Unique identifier of the dynamic search rule.

Example:

"movies"

actions
object[]
required

Actions to apply when the dynamic search rule matches.

description
string | null

Human-readable description of the dynamic search rule.

priority
integer<u-int64> | null

Precedence of the dynamic search rule. Lower numeric values take precedence over higher ones. If omitted, the rule is treated as having the lowest precedence. This precedence is used to resolve conflicts between matching rules:

  • If the same document is selected by multiple rules, the smallest priority number wins
  • If different documents are pinned to the same position, they are ordered by ascending priority
Required range: x >= 0
active
boolean

Whether the dynamic search rule is active.

conditions
object[]

Conditions that must match before the dynamic search rule applies.