fix(mcp): FTS colonnes non qualifiées + test positif search_notes

This commit is contained in:
2026-05-28 06:29:36 +02:00
parent e902452781
commit c72ffd0ad6
2 changed files with 8 additions and 1 deletions
+1 -1
View File
@@ -207,7 +207,7 @@ async def search_notes(
if query:
conditions.append(
text(
"to_tsvector('french', coalesce(notes.items.title,'') || ' ' || notes.items.content)"
"to_tsvector('french', coalesce(title,'') || ' ' || content)"
" @@ plainto_tsquery('french', :q)"
).bindparams(q=query)
)
+7
View File
@@ -84,6 +84,13 @@ async def test_search_notes_retourne_liste():
assert data == []
async def test_search_notes_fts_trouve_par_mot_cle():
await create_note(title="TEST_MCP_note_fts", content="recette de cuisine française traditionnelle")
result = await search_notes(query="cuisine")
data = json.loads(result)
assert any(n["title"] == "TEST_MCP_note_fts" for n in data)
async def test_create_note_outil():
result = await create_note(title="TEST_MCP_note_create", content="Contenu de test MCP")
data = json.loads(result)