Simple keyword search over documentation pages.
No external dependencies. Ranks results by weighted keyword frequency: title matches score higher than body matches.
docs.search
| Name | Type | Default | Description |
|---|---|---|---|
type
|
|
— | |
qualified_name
|
|
— | |
element_type
|
|
— | |
description
|
|
— | |
source_file
|
|
— | |
line_number
|
|
— | |
is_autodoc
|
|
— | |
autodoc_element
|
|
— | |
_autodoc_template
|
|
— | |
_autodoc_url_path
|
|
— | |
_autodoc_page_type
|
|
— | |
title
|
|
— | |
doc_content_hash
|
|
— |
Symbols on this page
keyword_search
function
def keyword_search(pages: tuple[DocPage, ...], query: str) -> tuple[DocPage, ...]
Return pages matching query, ranked by relevance.
Matching is case-insensitive. Each whitespace-separated token in query is searched independently — a page must contain all tokens to match (AND semantics).
Ranking: each token occurrence in the title scores 3 points, each occurrence in the raw body scores 1 point.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
pages
|
tuple[DocPage, ...]
|
— | |
query
|
str
|
— |
View source · /home/runner/work/chirp/chirp/site/../src/chirp/docs/search.py:1