0.9.3: `(A OR B) AND (id:x OR id:y OR id:z)` silently drops matching documents (tantivy BufferedUnion `seek_danger`, fixed on main, not released)
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ó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
Hướng nghiên cứu
Start by checking the Quickwit 0.9 dependency pins for tantivy and the BufferedUnionScorer::seek_danger behavior described in the report; compare them with the fix in tantivy#3088 and Quickwit main's #6815. Reproduce the supplied 12,001-document case and compare both query results and num_hits. Done means the filtered boosted query returns both d5000 and d12000, with correct counts.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Version: Quickwit 0.9.0 (reproduced); 0.9.1–0.9.3 pin tantivy revisions with the same
BufferedUnionScorer::seek_danger override, and the reporter sees the same symptom on 0.9.3 in production.
Linux x86_64, single node, file-backed metastore.
What happens
A disjunction of a conjunction with another conjunction, intersected with a disjunction of exact
terms, returns fewer documents than the conjunction alone, although the added clause can only widen
the match. num_hits is wrong too, including with max_hits: 0, so this is not top-k pruning.
Nothing errors.
Reproduction (12,001 documents, 3 of them with text)
index-config.yaml:
version: 0.8
index_id: union-repro
doc_mapping:
field_mappings:
- name: id
type: text
tokenizer: raw
stored: true
- name: title
type: text
tokenizer: default
record: position
- name: body
type: text
tokenizer: default
record: position
search_settings:
default_search_fields: [title, body]
indexing_settings:
commit_timeout_secs: 5
Documents: d0, d5000 and d12000 hold text; every other document is empty. The gaps between
matches are larger than tantivy's 4,096-document union horizon.
python3 -c '
import json
special = {0: ("apple banana", "apple banana"), 5000: ("", "apple banana"), 12000: ("", "apple banana")}
for i in range(12001):
t, b = special.get(i, ("", ""))
print(json.dumps({"id": "d%d" % i, "title": t, "body": b}))
' > docs.ndjson
QW=http://127.0.0.1:7280
curl -s -XPOST -H 'Content-Type: application/yaml' --data-binary @index-config.yaml $QW/api/v1/indexes
curl -s -XPOST --data-binary @docs.ndjson "$QW/api/v1/union-repro/ingest?commit=force"
# one split of 12,001 docs: curl -s $QW/api/v1/indexes/union-repro/splits
search() { curl -s -XPOST -H 'Content-Type: application/json' $QW/api/v1/union-repro/search \
-d "{\"query\": \"$1\", \"max_hits\": 10}"; }
search '(apple banana) AND (id:d5000 OR id:d10000 OR id:d12000)'
search '((apple banana) OR (title:apple title:banana)) AND (id:d5000 OR id:d10000 OR id:d12000)'
| Query | Expected | Actual on 0.9.0 |
|---|---|---|
(apple banana) AND (id:d5000 OR id:d10000 OR id:d12000) |
2: d5000, d12000 | 2: d5000, d12000 |
((apple banana) OR (title:apple title:banana)) AND (id:d5000 OR id:d10000 OR id:d12000) |
2: d5000, d12000 | 1: d5000 |
same, AND id:d12000 only |
1 | 1 |
same, AND (id:d5000 OR id:d12000) |
2 | 2 |
The search uses the default AND operator. Observations:
- The boost clause
title:apple title:bananamatches onlyd0, which is outside the id filter. d0must hold the words in its body as well as its title.- The id
d10000must be listed, although that document is empty. It forces a seek more than
4,096 documents past the previous candidate. - Removing
d0's title (so the second clause matches nothing) makes the result correct again.
Where it was found
The reporter's real queries had this shape, over default fields [title, headings, text]:
(("w1" "w2") OR (title:"w1 w2")^12 OR (title:"w1" title:"w2")^6 OR (text:"w1 w2")^4 OR (text:"w1 w2"~5)^2)
AND (url:"…" OR url:"…" OR …)
The shape is a relevance-boosted query restricted to a batch of exact URLs, on a ~700k-document
index. With 160 URLs in one batch, 5 of the 7 matches went missing. Removing the weights
did not help, and neither did any single phrase clause. The query was complete with the base clause
alone, and with a boost clause that matches no document anywhere. Whether it failed depended on
layout: one batch that failed came back complete after more merges.
Probable cause
tantivy#3086 / tantivy#3103. In the pinned revisions (057458b for 0.9.0–0.9.1, 71484e2 for
0.9.2–0.9.3), BufferedUnionScorer overrides seek_danger. Outside its horizon it forwards the
call to its children and stops at the first Found, then calls seek. seek reads doc() from
children that an earlier seek_danger may have left invalid, which the seek_danger contract
forbids. tantivy#3088 (0.26.2) removed the override. Quickwit main has carried it since #6815, but
71484e2 is a commit on a backport branch that does not include it.
Ask
Could the tantivy fix (#3088) be backported to the 0.9 branch and shipped in a 0.9.x patch release?
As far as we can tell, every released Quickwit since 0.9.0 can silently drop documents from
ordinary boosted queries combined with a filter. If you can, please also confirm the repro above
passes on main; we could not test a build with the fix.
Workaround for users, in the meantime: run membership lookups with the unboosted base, as
(base) AND (filter), and do any ranking separately.
- Ngôn ngữ chính
- Rust
- Star
- 11.8k
- Fork
- 628
- Merge trung bình
- 2 ngày 22 giờ
- Pull request đã merge (30 ngày)
- 50
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Có Dockerfile hoặc tệp Docker Compose
- 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 quickwit-oss/quickwit
-
area:otel documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
quickwit-oss/quickwit#6686 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add some examples of requests in the REST API reference docsCó thể đã có người làm @Cunninger đã nhận 88 ngày trước. Đang mởenhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
quickwit-oss/quickwit#4266 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
quickwit-oss/quickwit#3872 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Update docs on range queriesĐang mởdocumentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
quickwit-oss/quickwit#3666 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
implement retry for ListTermsĐang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
quickwit-oss/quickwit#2769 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của quickwit-oss/quickwit
Issue tương tự
-
p2 ready-mac
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/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 82/100
quickwit-oss/tantivy#3299 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`stream enable` fails with "already enabled" on every fresh session since streaming became always-onĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
vercel-labs/agent-browser#2797 ·
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 66/100
witchesofthehill/manabrew#1309 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug help wanted ui
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
userFRM/egui-charts#4494 ·
Maintainer thường phản hồi trong vòng 1 ngày