mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 10:28:27 +00:00
Basic poc to search via custom query
This commit is contained in:
@ -164,7 +164,7 @@ object OFulltext {
|
||||
.flatMap(r => Stream.emits(r.results.map(_.itemId)))
|
||||
.compile
|
||||
.to(Set)
|
||||
q = Query.empty(account).withCond(_.copy(itemIds = itemIds.some))
|
||||
q = Query.empty(account).withFix(_.copy(itemIds = itemIds.some))
|
||||
res <- store.transact(QItem.searchStats(q))
|
||||
} yield res
|
||||
}
|
||||
@ -220,7 +220,7 @@ object OFulltext {
|
||||
.flatMap(r => Stream.emits(r.results.map(_.itemId)))
|
||||
.compile
|
||||
.to(Set)
|
||||
qnext = q.withCond(_.copy(itemIds = items.some))
|
||||
qnext = q.withFix(_.copy(itemIds = items.some))
|
||||
res <- store.transact(QItem.searchStats(qnext))
|
||||
} yield res
|
||||
|
||||
|
@ -0,0 +1,13 @@
|
||||
package docspell.backend.ops
|
||||
|
||||
import docspell.backend.ops.OItemSearch.ListItemWithTags
|
||||
import docspell.common.ItemQueryString
|
||||
import docspell.store.qb.Batch
|
||||
|
||||
trait OSimpleSearch[F[_]] {
|
||||
|
||||
def searchByString(q: ItemQueryString, batch: Batch): F[Vector[ListItemWithTags]]
|
||||
|
||||
}
|
||||
|
||||
object OSimpleSearch {}
|
Reference in New Issue
Block a user