mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 02:18:26 +00:00
Pass language when updating fulltext index
This commit is contained in:
@ -576,7 +576,8 @@ object QItem {
|
||||
collective: Ident,
|
||||
folder: Option[Ident],
|
||||
name: String,
|
||||
notes: Option[String]
|
||||
notes: Option[String],
|
||||
language: Language
|
||||
)
|
||||
def allNameAndNotes(
|
||||
coll: Option[Ident],
|
||||
@ -584,10 +585,11 @@ object QItem {
|
||||
chunkSize: Int
|
||||
): Stream[ConnectionIO, NameAndNotes] = {
|
||||
val i = RItem.as("i")
|
||||
val c = RCollective.as("c")
|
||||
|
||||
Select(
|
||||
select(i.id, i.cid, i.folder, i.name, i.notes),
|
||||
from(i)
|
||||
select(i.id, i.cid, i.folder, i.name, i.notes, c.language),
|
||||
from(i).innerJoin(c, c.id === i.cid)
|
||||
).where(
|
||||
i.state.in(ItemState.validStates) &&?
|
||||
itemIds.map(ids => i.id.in(ids)) &&?
|
||||
|
@ -236,8 +236,18 @@ object RAttachment {
|
||||
n3 <- DML.delete(T, T.id === attachId)
|
||||
} yield n0 + n1 + n2 + n3
|
||||
|
||||
def findItemId(attachId: Ident): ConnectionIO[Option[Ident]] =
|
||||
Select(T.itemId.s, from(T), T.id === attachId).build.query[Ident].option
|
||||
def findItemAndLanguage(
|
||||
attachId: Ident
|
||||
): ConnectionIO[Option[(Ident, Option[Language])]] = {
|
||||
val a = RAttachment.as("a")
|
||||
val m = RAttachmentMeta.as("m")
|
||||
|
||||
Select(
|
||||
select(a.itemId, m.language),
|
||||
from(a).leftJoin(m, m.id === a.id),
|
||||
a.id === attachId
|
||||
).build.query[(Ident, Option[Language])].option
|
||||
}
|
||||
|
||||
def findAll(
|
||||
coll: Option[Ident],
|
||||
|
Reference in New Issue
Block a user