Top N records by a numeric field
catalog_topRank records by a numeric field with optional filters, returning sorted results in ascending or descending order.
Instructions
Rank records by a numeric field with an optional filter. Example: sort_by "price", sort_dir "asc", filter {"has":{"features":["Bunkhouse"]}} = cheapest records with that feature.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| fields | No | ||
| filter | No | Filter spec. Keys: eq (equality: {"type":"tent","heated":true}), min / max (numeric bounds: {"price":100}; records without a number in a bounded field are excluded), has (array membership, all required: {"tags":["a","b"]}), contains (case-insensitive substring: {"name":"alpine"}; use field "*" to search all string fields). | |
| sort_by | Yes | ||
| sort_dir | No | desc |