# search-articles > Query articles using category filters and BM25 keyword search - Author: GuillermoLB - Repository: GuillermoLB/fastpaip-app - Version: 20260106110114 - Stars: 3 - Forks: 0 - Last Updated: 2026-02-07 - Source: https://github.com/GuillermoLB/fastpaip-app - Web: https://mule.run/skillshub/@@GuillermoLB/fastpaip-app~search-articles:20260106110114 --- --- name: search-articles description: Query articles using category filters and BM25 keyword search version: 3.0.0 provider: fastpaip runtime: python3 tags: [search, articles, bm25, filtering, query] --- # Search Articles Query articles using structured category filters and BM25 full-text keyword search. ## Usage ```bash # List available categories python search.py --list-categories # Browse all articles python search.py --limit 10 # Filter by categories python search.py --categories NEWS SCIENTIFIC # Keyword search (BM25 full-text search) python search.py --keywords "machine learning" # Combined filters python search.py --categories SCIENTIFIC --keywords "biology" # JSON output for piping python search.py --keywords "API" --format json | jq '.results[].id' ``` ## Parameters | Parameter | Type | Description | |-----------|------|-------------| | `--list-categories` | flag | List all available article categories | | `--categories` | list | Filter by categories (NEWS, SCIENTIFIC, etc.) | | `--keywords` | string | BM25 full-text search keywords | | `--limit` | int | Maximum results (default: 10) | | `--offset` | int | Pagination offset (default: 0) | | `--format` | choice | Output: table, json, csv | | `--output` | path | Output file for json/csv | ## Output Formats ### Table (default) ``` Search Results (3 found) ┏━━━━┳━━━━━━━━━━━━┳━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ ID ┃ Category ┃ Score ┃ Snippet ┃ ┡━━━━╇━━━━━━━━━━━━╇━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━┩ │ 6 │ SCIENTIFIC │ 0.15 │ ...machine learning... │ └────┴────────────┴───────┴──────────────────────────┘ ``` ### JSON ```json { "results": [ { "id": 6, "raw_article": "...", "category": "SCIENTIFIC", "keyword_score": 0.15, "snippet": "...machine learning..." } ], "metadata": { "total_results": 3, "query_time_ms": 42.5, "strategies_used": ["bm25_keyword_search", "category_filter"] } } ``` ### CSV ```csv id,raw_article,category,keyword_score,snippet 6,"...","SCIENTIFIC",0.15,"...machine learning..." ``` ## Examples See [references/examples.md](references/examples.md) for 30+ usage examples including: - Category filtering - Keyword search strategies - Date range queries - Pagination - Composing with jq, grep, and other tools - Batch processing workflows