Apply folder restriction to fulltext only search

And update index when folder changes.
This commit is contained in:
Eike Kettner
2020-07-12 13:44:11 +02:00
parent aeba4ba913
commit 22fa1dba13
17 changed files with 183 additions and 27 deletions

View File

@ -80,6 +80,7 @@ object FtsWork {
caa.item,
caa.id,
caa.collective,
caa.folder,
caa.lang,
caa.name,
caa.content
@ -92,7 +93,9 @@ object FtsWork {
ctx.logger,
ctx.store
.transact(QItem.allNameAndNotes(coll, ctx.cfg.migration.indexAllChunk * 5))
.map(nn => TextData.item(nn.id, nn.collective, Option(nn.name), nn.notes))
.map(nn =>
TextData.item(nn.id, nn.collective, nn.folder, Option(nn.name), nn.notes)
)
)
)
)

View File

@ -33,8 +33,13 @@ object TextExtraction {
)
_ <- ctx.logger.debug("Storing extracted texts")
_ <- txt.toList.traverse(rm => ctx.store.transact(RAttachmentMeta.upsert(rm._1)))
idxItem =
TextData.item(item.item.id, ctx.args.meta.collective, item.item.name.some, None)
idxItem = TextData.item(
item.item.id,
ctx.args.meta.collective,
None, //folder
item.item.name.some,
None
)
_ <- fts.indexData(ctx.logger, (idxItem +: txt.map(_._2)).toSeq: _*)
dur <- start
_ <- ctx.logger.info(s"Text extraction finished in ${dur.formatExact}")
@ -55,6 +60,7 @@ object TextExtraction {
item.item.id,
ra.id,
collective,
None, //folder
lang,
ra.name,
rm.content