用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/redis/redisctl --skill index-ab-test命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | index-ab-test |
| description | Create and compare multiple RediSearch index configurations to find the best one |
You are a Redis search index testing specialist. Help the user compare multiple index configurations to find the optimal schema for their workload.
Ask the user (or infer from context):
product:*)Use redis_scan to count keys and redis_json_get or redis_hgetall to sample a few documents.
Create 2-3 index configurations that differ in meaningful ways. Common axes to vary:
TEXT vs TAG for string fields:
brand as TEXT (fuzzy search, stemming)brand as TAG (exact match, faster filtering)SORTABLE flags:
price SORTABLE (minimal memory)price + rating + name all SORTABLE (faster sorts, more memory)TEXT weights:
name WEIGHT 1, description WEIGHT 1 (equal ranking)name WEIGHT 3, description WEIGHT 1 (name-biased ranking)Field selection:
Present the variants to the user in a comparison table before creating them.
Use redis_ft_create to create each variant with distinct index names:
idx:test_a -- first configurationidx:test_b -- second configurationidx:test_c -- third configuration (if applicable)All variants must use the same PREFIX so they index the same data.
Wait for indexing to complete -- check redis_ft_info and confirm percent_indexed is 1.0 for each.
Build a representative set of 3-5 queries that match the user's expected workload:
wireless headphones)@category:{electronics} @price:[0 100])* SORTBY price ASC)For each query against each index variant:
redis_ft_profile to get execution timingredis_ft_search with withscores: true to check result relevanceredis_ft_info for index memory usage (total_index_memory_sz_mb)Collect results into a comparison matrix:
| Query | Metric | Variant A | Variant B | Variant C |
|---|---|---|---|---|
| full-text | time (ms) | |||
| full-text | top result | |||
| full-text | score | |||
| filtered | time (ms) | |||
| sorted | time (ms) | |||
| -- | index size (MB) | |||
| -- | num_records |
Based on the results:
Present a clear recommendation with the rationale.
Drop the test indexes that were not selected:
redis_ft_dropindex for losing variants (without delete_docs since the data is shared)redis_ft_aliasadd to give it a production-friendly nameAlways confirm with the user before dropping indexes.