Extend free-text search (q) to also match payload
All checks were successful
Build and Deploy iObj / build-image (push) Successful in 36s

Cross-shard search already worked transparently across all monthly
JSON files. This adds payload content (e.g. commit SHA, meeting
attendees, structured data) to the q= substring match, alongside
title and body.
This commit is contained in:
2026-07-13 21:57:45 +02:00
parent 10e98e1bdc
commit dc45e825c9
3 changed files with 16 additions and 2 deletions

View File

@@ -119,6 +119,18 @@ def test_search_free_text_matches_title_and_body(store):
assert len(results) == 2
def test_search_free_text_matches_payload(store):
store.create(_mk(title="commit", payload={"sha": "abc123def", "author": "Henrik Jess"}))
store.create(_mk(title="other commit", payload={"sha": "zzz999", "author": "Someone Else"}))
results = store.search(SearchQuery(q="abc123def"))
assert len(results) == 1
assert results[0].title == "commit"
results = store.search(SearchQuery(q="henrik"))
assert len(results) == 1
assert results[0].title == "commit"
def test_search_respects_limit_and_offset_and_sort_order(store):
for i in range(5):
store.create(_mk(object_date=date(2026, 1, 1 + i), title=f"obj{i}"))