fix(search): register fast-field tokenizer for simple_analyzer; fix perm_index fixture

Tantivy requires register_fast_field_tokenizer for any tokenizer used by
fast=True text fields — it writes default fast column values on every commit
even when a document omits those fields, raising ValueError otherwise.

perm_index fixture simplified to use in-memory index (path=None).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Trenton H
2026-03-29 15:01:39 -07:00
co-authored by Claude Sonnet 4.6
parent 33da63c229
commit 957049c512
2 changed files with 11 additions and 5 deletions
+3 -4
View File
@@ -214,11 +214,10 @@ class TestPermissionFilter:
"""build_permission_filter tests use an in-memory index — no DB access needed."""
@pytest.fixture
def perm_index(self, tmp_path) -> tantivy.Index:
# Use a temporary directory instead of in-memory index to avoid tokenizer issues
def perm_index(self) -> tantivy.Index:
schema = build_schema()
idx = tantivy.Index(schema, path=str(tmp_path))
register_tokenizers(idx, "en")
idx = tantivy.Index(schema, path=None)
register_tokenizers(idx, "")
return idx
def _add_doc(