Reformat with scalafmt 3.0.0

This commit is contained in:
Scala Steward
2021-08-19 08:50:30 +02:00
parent 5a2a0295ef
commit e4fecefaea
127 changed files with 558 additions and 658 deletions

View File

@ -14,32 +14,28 @@ import docspell.common._
import org.log4s.getLogger
/** The fts client is the interface for docspell to a fulltext search
* engine.
/** The fts client is the interface for docspell to a fulltext search engine.
*
* It defines all operations required for integration into docspell.
* It uses data structures from docspell. Implementation modules need
* to translate it to the engine that provides the features.
* It defines all operations required for integration into docspell. It uses data
* structures from docspell. Implementation modules need to translate it to the engine
* that provides the features.
*/
trait FtsClient[F[_]] {
/** Initialization tasks. This can be used to setup the fulltext
* search engine. The implementation is expected to keep track of
* run migrations, so that running these is idempotent. For
* example, it may be run on each application start.
/** Initialization tasks. This can be used to setup the fulltext search engine. The
* implementation is expected to keep track of run migrations, so that running these is
* idempotent. For example, it may be run on each application start.
*
* Initialization may involve re-indexing all data, therefore it
* must run outside the scope of this client. The migration may
* include a task that applies any work and/or it can return a
* result indicating that after this task a re-index is necessary.
* Initialization may involve re-indexing all data, therefore it must run outside the
* scope of this client. The migration may include a task that applies any work and/or
* it can return a result indicating that after this task a re-index is necessary.
*/
def initialize: F[List[FtsMigration[F]]]
/** A list of initialization tasks that can be run when re-creating
* the index.
/** A list of initialization tasks that can be run when re-creating the index.
*
* This is not run on startup, but only when required, for example
* when re-creating the entire index.
* This is not run on startup, but only when required, for example when re-creating the
* entire index.
*/
def initializeNew: List[FtsMigration[F]]
@ -53,18 +49,16 @@ trait FtsClient[F[_]] {
else Stream.emit(result) ++ searchAll(q.nextPage)
}
/** Push all data to the index. Data with same `id' is replaced.
* Values that are `None' are removed from the index (or set to an
* empty string).
/** Push all data to the index. Data with same `id' is replaced. Values that are `None'
* are removed from the index (or set to an empty string).
*/
def indexData(logger: Logger[F], data: Stream[F, TextData]): F[Unit]
def indexData(logger: Logger[F], data: TextData*): F[Unit] =
indexData(logger, Stream.emits(data))
/** Push all data to the index, but only update existing entries. No
* new entries are created and values that are given as `None' are
* skipped.
/** Push all data to the index, but only update existing entries. No new entries are
* created and values that are given as `None' are skipped.
*/
def updateIndex(logger: Logger[F], data: Stream[F, TextData]): F[Unit]

View File

@ -10,16 +10,14 @@ import docspell.common._
/** A fulltext query.
*
* The query itself is a raw string. Each implementation may
* interpret it according to the system in use.
* The query itself is a raw string. Each implementation may interpret it according to
* the system in use.
*
* Searches must only look for given collective and in the given list
* of item ids, if it is non-empty. If the item set is empty, then
* don't restrict the result in this way.
* Searches must only look for given collective and in the given list of item ids, if it
* is non-empty. If the item set is empty, then don't restrict the result in this way.
*
* The set of folders must be used to restrict the results only to
* items that have one of the folders set or no folder set. If the
* set is empty, the restriction does not apply.
* The set of folders must be used to restrict the results only to items that have one of
* the folders set or no folder set. If the set is empty, the restriction does not apply.
*/
final case class FtsQuery(
q: String,