Skip to content

bug: blog search only searches the current page, so most posts can't be found #2742

Description

@abhinav-m22

Describe the bug

The search box on the blog page only filters the 10 posts shown on that page, not all 21 posts on the site. So most posts can never be found from /blog - the search just says "No posts found" even though the post exists and opens fine by URL.

It also hides the pagination as soon as you type, so you can't move to the next page to keep looking.

To Reproduce

  1. Go to https://vllm-sr.ai/blog
  2. Type "Athena" into the search box at the top
  3. The page shows "No posts found. Try a different title, topic, or tag."
  4. But that post does exist: https://vllm-sr.ai/blog/v0.2-vllm-sr-athena-release
    It's the 12th newest post, so it sits on page 2 and the search can't see it.
  5. Also notice the "Older Entries" pagination at the bottom disappears while there is text in the search box.

Expected behavior

Searching "Athena" should find the v0.2 Athena post.

The search should cover all blog posts, not just the ones rendered on the current page.

Affected layer

unsure

Additional context

The blog has 21 posts and docusaurus.config.ts sets postsPerPage: 10, so there are 3 pages.

In website/src/theme/BlogListPage/index.tsx the filter runs over items (~line 153), but Docusaurus only puts the current page's posts into items - the full list is never available to that component. Line 239 also hides the paginator whenever a query is active.

Screenshots attached.

page 1 (main screen):

Image

page 2:

Image

Edit: dropping the pagination requirement. It was a workaround for the page-scoped search. Once search covers the whole archive there's nothing to page to, and the paginator's page numbers describe the unfiltered blog, so showing it next to results would be misleading.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status
In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions