feat(search): thread lang through NlSearchRequest → controller → NlQueryParserService → NlpClient

- NlSearchRequest gains @NotBlank @Pattern(regexp="de|en|es") lang field
- NlSearchController passes request.lang() to service
- NlQueryParserService.search signature: (String, String, Pageable); renames ollamaClient→nlpClient; removes redundant length guard (Bean Validation is enforcement point)
- application.yaml: replaces app.ollama.* with app.nlp.base-url; application-dev.yaml: points to localhost:8001
- frontend/documents/+page.svelte: sends lang: languageTag() in POST body

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-06-07 15:58:48 +02:00
parent 34387f2d59
commit 8bed0cc6e2
6 changed files with 15 additions and 20 deletions

View File

@@ -17,6 +17,7 @@ import { bulkSelectionStore } from '$lib/document/bulkSelection.svelte';
import { getErrorMessage, parseBackendError } from '$lib/shared/errors';
import { csrfFetch } from '$lib/shared/cookies';
import * as m from '$lib/paraglide/messages.js';
import { languageTag } from '$lib/paraglide/runtime';
import type { components } from '$lib/generated/api';
type NlQueryInterpretation = components['schemas']['NlQueryInterpretation'];
@@ -224,7 +225,7 @@ async function runSmartSearch() {
const res = await csrfFetch('/api/search/nl', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ query })
body: JSON.stringify({ query, lang: languageTag() })
});
if (!res.ok) {
const backend = await parseBackendError(res);