fix(mcp): FTS colonnes non qualifiées + test positif search_notes
This commit is contained in:
@@ -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)
|
||||
)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user