Fixing bug where multiple words could not be used in docs search.

This commit is contained in:
Roland 2026-03-20 16:26:04 -06:00
parent 1c79c1c495
commit 14cfc87bce
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
2 changed files with 12 additions and 1 deletions

View file

@ -30,6 +30,17 @@ async def test_docs_search(async_client, test_session, test_directory, example_e
assert len(response.json['file_groups']) >= 1
@pytest.mark.asyncio
async def test_docs_search_multi_word(async_client, test_session, test_directory, example_epub, refresh_files):
"""Docs search handles multi-word queries without tsquery syntax errors."""
await refresh_files()
# Multi-word search should not raise a syntax error.
content = dict(search_str='primitive fire starting friction methods')
request, response = await async_client.post('/api/docs/search', content=json.dumps(content))
assert response.status_code == HTTPStatus.OK
@pytest.mark.asyncio
async def test_get_doc(async_client, test_session, test_directory, example_epub, refresh_files):
"""Single doc endpoint returns the doc."""