mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 02:18:26 +00:00
Get basic search summary
This commit is contained in:
@ -66,8 +66,8 @@ trait OCollective[F[_]] {
|
||||
|
||||
object OCollective {
|
||||
|
||||
type TagCount = QCollective.TagCount
|
||||
val TagCount = QCollective.TagCount
|
||||
type TagCount = docspell.store.queries.TagCount
|
||||
val TagCount = docspell.store.queries.TagCount
|
||||
|
||||
type InsightData = QCollective.InsightData
|
||||
val insightData = QCollective.InsightData
|
||||
|
@ -24,6 +24,8 @@ trait OItemSearch[F[_]] {
|
||||
maxNoteLen: Int
|
||||
)(q: Query, batch: Batch): F[Vector[ListItemWithTags]]
|
||||
|
||||
def findItemsSummary(q: Query): F[SearchSummary]
|
||||
|
||||
def findAttachment(id: Ident, collective: Ident): F[Option[AttachmentData[F]]]
|
||||
|
||||
def findAttachmentSource(
|
||||
@ -53,6 +55,9 @@ trait OItemSearch[F[_]] {
|
||||
|
||||
object OItemSearch {
|
||||
|
||||
type SearchSummary = queries.SearchSummary
|
||||
val SearchSummary = queries.SearchSummary
|
||||
|
||||
type CustomValue = queries.CustomValue
|
||||
val CustomValue = queries.CustomValue
|
||||
|
||||
@ -139,6 +144,12 @@ object OItemSearch {
|
||||
.toVector
|
||||
}
|
||||
|
||||
def findItemsSummary(q: Query): F[SearchSummary] =
|
||||
for {
|
||||
tags <- store.transact(QItem.searchTagSummary(q))
|
||||
count <- store.transact(QItem.searchCountSummary(q))
|
||||
} yield SearchSummary(count, tags)
|
||||
|
||||
def findAttachment(id: Ident, collective: Ident): F[Option[AttachmentData[F]]] =
|
||||
store
|
||||
.transact(RAttachment.findByIdAndCollective(id, collective))
|
||||
|
Reference in New Issue
Block a user