Skip to content

Improve docs search ranking for API queries#701

Merged
cvanelteren merged 1 commit intomainfrom
docs/prioritize-api-search
Apr 23, 2026
Merged

Improve docs search ranking for API queries#701
cvanelteren merged 1 commit intomainfrom
docs/prioritize-api-search

Conversation

@cvanelteren
Copy link
Copy Markdown
Collaborator

Summary:

  • Treat generic query words like function, method, API, and reference as search intent instead of object-name filters.
  • Boost API object references and API pages for API-shaped docs searches so queries like format function surface format() reference anchors first.
  • Add a JS-backed pytest for the search hook behavior.

Checks:

  • black ultraplot/tests/test_docs_search.py
  • node --check docs/_static/custom.js
  • pytest ultraplot/tests/test_docs_search.py -q
  • pytest -n 4 ultraplot/tests/test_docs_search.py ultraplot/tests/test_docs_fetch_releases.py -q
  • Simulated the built Sphinx index for format function and confirmed API object anchors are the top displayed results.

…ad of guide pages for API-shaped queries such as format function, while keeping guide results available lower in the list.
@cvanelteren cvanelteren merged commit f140c93 into main Apr 23, 2026
16 of 17 checks passed
@cvanelteren cvanelteren deleted the docs/prioritize-api-search branch April 23, 2026 02:51
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 23, 2026

Codecov Report

❌ Patch coverage is 87.50000% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
ultraplot/tests/test_docs_search.py 87.50% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant