---
updatedAt: 2026-07-07T07:30:13.000Z
agentTools:
  projectIndex: https://docs.getembed.ai/llms.txt
---

# Filter Cookbook

Use these recipes as starting points for Console filters, Search API payloads, or `algo-dsl` search builders.

## High-Volume Open Polymarket Markets

```js
mbd.search()
  .index("polymarket-items")
  .include().numeric("volume_24hr", 1000)
  .include().term("closed", false)
  .sortBy("volume_24hr", "desc")
  .size(50);
```

## Exclude Missing Fields

```js
mbd.search()
  .index("polymarket-items")
  .include().notNull("liquidity_num")
  .exclude().isNull("question");
```

## Match Account In-App Users

Use this when you have pushed your own users or wallets through Data Sources and want to filter to that account-owned set.

```js
mbd.search()
  .index("polymarket-wallets")
  .include().inAppUsers("wallet_address");
```

## Match Console Account Data

Use `console_account` when the match value lives in account-scoped console data.

```json
{
  "filter": "console_account",
  "field": "wallet_address",
  "path": "in_app_users",
  "value": "0xabc..."
}
```

## Boost Preferred Labels

```js
mbd.search()
  .index("polymarket-items")
  .include().date("item_creation_timestamp", "now-7d", "now")
  .boost().terms("ai_labels_med", ["crypto", "markets"], 2.0);
```

## Semantic Candidate Expansion

```js
await mbd.search()
  .index("polymarket-items")
  .semantic("liquid election markets with active trader discussion")
  .size(30)
  .execute();
```

## Leaderboard Wallets

```js
await mbd.search()
  .index("polymarket-wallets")
  .include().numeric("num_trades_30d", 5)
  .asLeaderboard()
  .traderScore((wallet) => {
    const pnl = wallet.realized_pnl_usd || wallet.pnl || 0;
    const trades = wallet.num_trades_30d || 1;
    return pnl / Math.sqrt(trades);
  })
  .execute();
```

## Discover Filter Values

```js
const tags = await mbd.search()
  .index("polymarket-items")
  .frequentValues("tags", 25);
```

## Data-Source User Interactions

For user-to-user events, use `user_id_from` and `user_id_to`.

```json
{
  "user_id_from": "user.123",
  "user_id_to": "user.456",
  "event_type": "follow",
  "timestamp": 1762300000
}
```