File size: 653 Bytes
02af15b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
"""Search request/response models."""

from __future__ import annotations

from datetime import datetime

from pydantic import BaseModel, Field


class SearchResult(BaseModel):
    """Full-text search result payload."""

    note_path: str
    title: str
    snippet: str = Field(..., description="Highlighted body excerpt")
    score: float = Field(..., description="Relevance score (weighted by field)")
    updated: datetime


class SearchRequest(BaseModel):
    """Full-text search query parameters."""

    query: str = Field(..., min_length=1, max_length=256)
    limit: int = Field(50, ge=1, le=100)


__all__ = ["SearchResult", "SearchRequest"]