|
|
|
|
@ -312,6 +312,19 @@ class DatasetProcessRule(Base):
|
|
|
|
|
except JSONDecodeError:
|
|
|
|
|
return None
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
|
def total_documents(self):
|
|
|
|
|
return db.session.query(func.count(Document.id)).filter(Document.dataset_id == self.dataset_id).scalar()
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
|
def total_available_documents(self):
|
|
|
|
|
return db.session.query(func.count(Document.id)).filter(
|
|
|
|
|
Document.dataset_id == self.dataset_id,
|
|
|
|
|
Document.indexing_status == "completed",
|
|
|
|
|
Document.enabled == True,
|
|
|
|
|
Document.archived == False,
|
|
|
|
|
).scalar()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Document(Base):
|
|
|
|
|
__tablename__ = "documents"
|
|
|
|
|
|