Source code for org.models.search

from __future__ import annotations

import math

from functools import cached_property
from onegov.core.collection import Pagination
from onegov.event.models import Event
from onegov.search import SearchIndex
from onegov.search.utils import language_from_locale, normalize_text
from sedate import utcnow
from sqlalchemy import case, func, inspect
from sqlalchemy.dialects.postgresql import UUID
from sqlalchemy_utils import escape_like


from typing import TYPE_CHECKING, Any
if TYPE_CHECKING:
    from onegov.org.request import OrgRequest
    from onegov.search import Searchable
    from sqlalchemy.orm import Query