Basic poc to search via custom query

This commit is contained in:
Eike Kettner
2021-02-25 22:40:17 +01:00
parent 186014a1c6
commit e9ed998e3a
10 changed files with 97 additions and 23 deletions

View File

@ -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

View File

@ -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 {}