Phrase queries with a position hole match across adjacent values of a multi-valued field, and trace disagrees
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start with phrase_query in src/engine.rs (around lines 2250-2282) to see how query offsets are built when a stop word leaves a hole, and with the trace logic around lines 1837-1881. Tantivy's postings_writer.rs (lines 156-162) explains the cross-value gap. Reproduce with one multi-valued record and the query "alpha the bravo". Done means a maintainer has chosen between changing the index positions and documenting the behavior, and trace agrees with the index for that case.
由索引模型根据 Issue 内容生成。
描述
Summary
A phrase query whose analyzed form has a position hole (a removed stop word, and probably a dropped over-long token) can match across two adjacent values of a multi-valued field. traceMatches analyzes each value separately and reports no match, so the record is returned with no highlight.
Found in a review of main at d94fc36. Not documented in the README or docs/limits.md.
Reproduction
Stop words enabled; one record with body: ["zebra alpha", "bravo yak"]; phrase query "alpha the bravo".
| Step | Result | Label |
|---|---|---|
| The query compiles to terms at offsets 0 and 2 (the stop word leaves a hole). | — | verified, src/engine.rs:2250-2282 (phrase_query) |
Tantivy places the first token of the next value at last position + 2 (POSITION_GAP = 1). |
alpha and bravo end up two positions apart |
verified in Tantivy 0.27.0 postings/postings_writer.rs:156-162 |
| The record is returned as a phrase match. | wrong result | observed, in a probe against the public Rust API |
Trace reports no match with complete: true. |
hit without highlight | observed, same probe; trace side is src/engine.rs:1837-1881 |
| A removed token of 40 bytes or more opens the same hole. | — | hypothesis; it also advances the position, but was not run |
| Boolean trace under NOT inverts membership relative to the index for such a record. | — | hypothesis; no Boolean trace was run |
Options
| Option | Cost |
|---|---|
| Start each value's token positions at an offset larger than the largest possible phrase gap | Changes the persisted postings, so it needs an analyzer identity bump and a rebuild |
| Keep the index behavior, document it, and make trace mirror the index so hits and highlights agree | No rebuild; the cross-value match stays |
Expose phrase slop for proximity search #53 would widen the affected set if it ships before this is settled, since slop tolerates larger gaps.
Issue generated by kAIle (Claude Fable 5.2)
- 主要语言
- Rust
- 星标
- 3
- 派生
- 0
- 平均合并
- 20 小时 29 分钟
- 30 天内合并 PR
- 13
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
HarperFast/fulltext 的其他 Issue
-
难度 5/5 一周以上 新手友好度 15/100
HarperFast/fulltext#91 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 25/100
HarperFast/fulltext#90 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 18/100
HarperFast/fulltext#89 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 25/100
HarperFast/fulltext#76 · 5 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 42/100
HarperFast/fulltext#74 ·
维护者通常 1 天内回复
查看 HarperFast/fulltext 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
DioxusLabs/blitz#1614 ·
维护者通常 1 天内回复
-
in progress
难度 2/5 1-3 小时 新手友好度 79/100
manuscript-lang/manuscript#4385 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
boxlite-ai/boxlite#2777 ·
维护者通常 1 天内回复
-
custom-types postgres
难度 2/5 1-3 小时 新手友好度 77/100
tursodatabase/turso#11908 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复