mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2026-11-20 01:24:15 +00:00
Phrase prefix (`"..."*`) and slop (`"..."~N`) were silently dropped on JSON fields. `generate_literals_for_json_object` hard-coded `slop: 0` and `prefix: false`, so a query like `data.name:"foo bar"*` degraded to an exact phrase, even though the underlying `PhrasePrefixQuery` already supports JSON-path terms. Thread `slop`/`prefix` through the JSON branch, exactly as the `Str` branch already does, and add the "phrase prefix requires at least two terms" guard for the single-token case (mirroring `generate_literals_for_str`). Tests added as JSON analogues of the existing text-field tests: - test_phrase_prefix_on_json_field - test_phrase_prefix_too_short_on_json_field - test_phrase_slop_on_json_field This aligns JSON fields with the phrase `~`/`*` behavior already documented for `QueryParser`.