Refactor findItemsWithTags to more general useful

This commit is contained in:
Eike Kettner
2020-06-23 21:27:01 +02:00
parent 647911563e
commit d9f0f05613
4 changed files with 24 additions and 8 deletions

View File

@ -24,6 +24,7 @@ trait FtsClient[F[_]] {
/** Run a full-text search. */
def search(q: FtsQuery): F[FtsResult]
/** Continually run a full-text search and concatenate the results. */
def searchAll(q: FtsQuery): Stream[F, FtsResult] =
Stream.eval(search(q)).flatMap { result =>
if (result.results.size < q.limit) Stream.emit(result)

View File

@ -8,7 +8,8 @@ import docspell.common._
* interpret it according to the system in use.
*
* Searches must only look for given collective and in the given list
* of item ids.
* of item ids, if it is non-empty. If the item set is empty, then
* don't restrict the result in this way.
*/
final case class FtsQuery(
q: String,