project.py 726 Bytes
from typing import List, Any, Dict

from presupuestov1.schema import BaseModel


class ProjectSearch(BaseModel):
    gestion: int
    devengado: float
    is_class: bool
    class_: str
    texto: str
    metadatos: str


class SearchHitHighlight(BaseModel):
    field: str
    matched_tokens: List[str]
    snippet: str


class SearchHits(BaseModel):
    document: ProjectSearch
    highlights: List[SearchHitHighlight]


class SearchFacet_(BaseModel):
    value: str
    count: int


class SearchFacet(BaseModel):
    counts: List[SearchFacet_]
    field_name: str


class Search(BaseModel):
    facet_counts: List[SearchFacet]
    found: int
    out_of: int
    page: int
    search_time_ms: int
    hits: List[SearchHits]