fix(batch_create_segment_to_index_task): count max_position in memory. (#12929)
This commit is contained in:
parent
c62b7cc679
commit
f91f5c7401
2 changed files with 78 additions and 62 deletions
|
|
@ -13,6 +13,7 @@ from typing import Any, cast
|
|||
|
||||
from sqlalchemy import func
|
||||
from sqlalchemy.dialects.postgresql import JSONB
|
||||
from sqlalchemy.orm import Mapped
|
||||
|
||||
from configs import dify_config
|
||||
from core.rag.retrieval.retrieval_methods import RetrievalMethod
|
||||
|
|
@ -515,7 +516,7 @@ class DocumentSegment(db.Model): # type: ignore[name-defined]
|
|||
tenant_id = db.Column(StringUUID, nullable=False)
|
||||
dataset_id = db.Column(StringUUID, nullable=False)
|
||||
document_id = db.Column(StringUUID, nullable=False)
|
||||
position = db.Column(db.Integer, nullable=False)
|
||||
position: Mapped[int]
|
||||
content = db.Column(db.Text, nullable=False)
|
||||
answer = db.Column(db.Text, nullable=True)
|
||||
word_count = db.Column(db.Integer, nullable=False)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue