fix: brain search — Meilisearch settings use PATCH not PUT

Settings were failing with 405 (PUT not supported in Meilisearch v1.12).
Changed to PATCH. Filterable/searchable attributes now applied.
Keyword search working: wedding, yusuf, insurance, airport all return results.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Yusuf Suleman
2026-04-01 19:48:27 -05:00
parent f7fd7cf7d5
commit 85a075260d
2 changed files with 8 additions and 8 deletions

View File

@@ -920,10 +920,10 @@
.viewer-layout { .viewer-layout {
display: grid; display: grid;
grid-template-columns: 1fr 300px; grid-template-columns: 1fr 440px;
width: 90vw; width: 94vw;
max-width: 1100px; max-width: 1300px;
height: 80vh; height: 85vh;
border-radius: 24px; border-radius: 24px;
overflow: hidden; overflow: hidden;
box-shadow: 0 32px 80px rgba(18,13,10,0.3); box-shadow: 0 32px 80px rgba(18,13,10,0.3);
@@ -961,11 +961,11 @@
.viewer-sidebar { .viewer-sidebar {
background: linear-gradient(180deg, #f8f1e8 0%, #f3eadc 100%); background: linear-gradient(180deg, #f8f1e8 0%, #f3eadc 100%);
border-left: 1px solid rgba(35,26,17,0.08); border-left: 1px solid rgba(35,26,17,0.08);
padding: 22px; padding: 28px;
overflow-y: auto; overflow-y: auto;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 14px; gap: 18px;
} }
.viewer-sidebar-header { .viewer-sidebar-header {

View File

@@ -37,8 +37,8 @@ async def _meili_request(method: str, path: str, json_data: dict = None) -> dict
async def ensure_meili_index(): async def ensure_meili_index():
"""Create the Meilisearch index if it doesn't exist.""" """Create the Meilisearch index if it doesn't exist."""
await _meili_request("POST", "indexes", {"uid": MEILI_INDEX, "primaryKey": "id"}) await _meili_request("POST", "indexes", {"uid": MEILI_INDEX, "primaryKey": "id"})
# Set filterable attributes # Set filterable attributes (PATCH for Meilisearch v1.x)
await _meili_request("PUT", f"indexes/{MEILI_INDEX}/settings", { await _meili_request("PATCH", f"indexes/{MEILI_INDEX}/settings", {
"filterableAttributes": ["user_id", "folder", "tags", "type", "processing_status"], "filterableAttributes": ["user_id", "folder", "tags", "type", "processing_status"],
"searchableAttributes": ["title", "extracted_text", "summary", "url"], "searchableAttributes": ["title", "extracted_text", "summary", "url"],
"sortableAttributes": ["created_at"], "sortableAttributes": ["created_at"],