Skip to content

Commit 235cd0c

Browse files
committed
Finally commit the missing file
1 parent 208277e commit 235cd0c

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

src/onegov/search/search_index.py

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
from __future__ import annotations
2+
3+
from sqlalchemy import Column, Integer, String
4+
from sqlalchemy.dialects.postgresql import JSONB, TSVECTOR
5+
6+
from onegov.core.orm import Base
7+
from onegov.core.orm.types import UUID
8+
9+
10+
class SearchIndex(Base):
11+
""" Full Text Search Index (fts) for all searchable models and entries.
12+
13+
This table contains index information for all searchable models,
14+
including the owner of the index, the type of the owner, and the
15+
full-text search data. It is used to facilitate efficient searching
16+
across different models and entries.
17+
18+
"""
19+
20+
__tablename__ = 'search_index'
21+
22+
id = Column(Integer, primary_key=True)
23+
24+
owner_type = Column(String, nullable=False)
25+
26+
owner_id_int = Column(Integer, nullable=True)
27+
28+
owner_id_uuid = Column(UUID, nullable=True)
29+
30+
owner_id_str = Column(String, nullable=True)
31+
32+
fts_idx_data = Column(JSONB, default={})
33+
34+
fts_idx = Column(TSVECTOR)
35+
36+
__mapper_args__ = {
37+
'polymorphic_on': owner_type
38+
}

0 commit comments

Comments
 (0)