mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-04-04 18:39:33 +00:00
Return classifier results as suggestions
This commit is contained in:
parent
75573c905e
commit
3ff9284a64
@ -119,7 +119,7 @@ object QAttachment {
|
||||
|
||||
def getMetaProposals(itemId: Ident, coll: Ident): ConnectionIO[MetaProposalList] = {
|
||||
val q = Select(
|
||||
am.proposals.s,
|
||||
select(am.proposals, am.classifyProposals),
|
||||
from(am)
|
||||
.innerJoin(a, a.id === am.id)
|
||||
.innerJoin(item, a.itemId === item.id),
|
||||
@ -127,8 +127,15 @@ object QAttachment {
|
||||
).build
|
||||
|
||||
for {
|
||||
ml <- q.query[MetaProposalList].to[Vector]
|
||||
} yield MetaProposalList.flatten(ml)
|
||||
ml <- q.query[(MetaProposalList, Option[MetaProposalList])].to[Vector]
|
||||
pairs = ml.foldLeft(
|
||||
(Vector.empty[MetaProposalList], Vector.empty[MetaProposalList])
|
||||
) { case ((vl, vr), (m, o)) =>
|
||||
(vl.appended(m), o.map(vr.appended).getOrElse(vr))
|
||||
}
|
||||
} yield MetaProposalList
|
||||
.flatten(pairs._1)
|
||||
.fillEmptyFrom(MetaProposalList.flatten(pairs._2))
|
||||
}
|
||||
|
||||
def getAttachmentMeta(
|
||||
|
Loading…
x
Reference in New Issue
Block a user