Pagefind search: limit counts flattened items, so broad queries show only 2–3 documents
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 68/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript
- Lĩnh vực
- search
Hướng nghiên cứu
Start in resources/search/quarto-search.js at pagefindSearch() (around lines 911–954) and follow how items is flattened and sliced before reshape groups it. Reproduce with a broad query such as oauth using default website.search.limit, then compare the shown count with Pagefind's results.length; also inspect the kItemTypeMore card and collapse-after handling. Done means broad queries surface more documents and visibly report cut matches, without excessive per-keystroke result.data() fetches (debounce or lazy fragments if needed).
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
With Pagefind search, broad queries show only the first few matching documents, and the panel gives no sign that more exist. On a large docs site (~hundreds of pages), searching oauth shows "3 matching documents" while Pagefind's index has 94 matches. The Quarto 1 (Fuse) build of the same sources listed 31.
| Query | Shown (q2) | Pagefind matches | Shown (Quarto 1) |
|---|---|---|---|
| oauth | 3 | 94 | 31 |
| ldap | 2 | 36 | 20 |
| licensing | 3 | 56 | 14 |
| kubernetes | 7 | 67 | 22 |
| vanity | 17 | 22 | 22 |
| saml | 13 | 27 | 6 |
(Measured with q2 0.43.0 and Pagefind 1.5.2, default website.search options, so limit is 50.)
Cause
pagefindSearch() in resources/search/quarto-search.js (main):
- takes the top
maxPagefind results (max=website.search.limit, default 50), - builds a flat list document by document: one item for the document, then one item for each of its matching sections,
- returns
items.slice(0, max).
The comment says "limit caps items, as it did in Quarto 1." The count matches Quarto 1, but the order does not. Fuse ranked sections across all documents, so 50 items covered ~30 documents. Here, a few pages with many matching sections use up the whole budget. For oauth, the top documents contribute 11, 24, 24, 24, 26, 12 items, so the running total passes 50 inside document 3, and documents 4–94 are never shown.
The cut also happens before reshape groups items, so the "N more matches" card (kItemTypeMore) never covers it. That card only counts sections hidden by collapse-after inside a document that is shown. The user gets no hint that results were dropped.
Possible fixes
- Make
limitcap documents for Pagefind, not flattened items (and/or cap sections per document before the slice), so each shown document has room. - Or interleave sections across documents by score, the way Fuse did, before slicing.
- Either way, show a "more results" sign when matches are cut, e.g. use Pagefind's total
results.lengthin the header.
Watch the cost: pagefindSearch() calls result.data() (one fragment fetch) for each result it keeps, and the input is not debounced. Raising the number of documents loaded raises per-keystroke fetches on broad queries (e.g. 136 for integrations). A debounce, or loading fragments lazily, may be needed with the fix.
Workaround
Set a larger website.search.limit (e.g. 500) in _quarto.yml, at the fragment-fetch cost described above.
- Ngôn ngữ chính
- Rust
- Star
- 316
- Fork
- 23
- Merge trung bình
- 11 giờ 49 phút
- Pull request đã merge (30 ngày)
- 245
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của quarto-dev/q2
-
Heading anchor links have no icon: AnchorJS is initialised with an empty `icon`Có thể đã có người làm @cscheid đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
quarto-dev/q2#1419 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug testing windows
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 78/100
quarto-dev/q2#1346 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
quarto-dev/q2#1095 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 67/100
quarto-dev/q2#1418 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug readers-writers windows
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
quarto-dev/q2#1416 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của quarto-dev/q2
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 82/100
BurntSushi/jiff#755 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
After the kernel is given up on, a new import leaves "Importing…" and its Cancel on the status lineĐang mởbug help wanted priority: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
sawhorse3d/sawhorse#163 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
MartinPTielemans/ilo#4607 ·