mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-02-22 14:03:26 +00:00
37 lines
749 B
Scala
37 lines
749 B
Scala
/*
|
|
* Copyright 2020 Eike K. & Contributors
|
|
*
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
*/
|
|
|
|
package docspell.ftsclient
|
|
|
|
import docspell.common._
|
|
import docspell.ftsclient.FtsResult.ItemMatch
|
|
|
|
final case class FtsResult(
|
|
qtime: Duration,
|
|
count: Int,
|
|
maxScore: Double,
|
|
highlight: Map[Ident, List[String]],
|
|
results: List[ItemMatch]
|
|
) {}
|
|
|
|
object FtsResult {
|
|
|
|
val empty =
|
|
FtsResult(Duration.millis(0), 0, 0.0, Map.empty, Nil)
|
|
|
|
sealed trait MatchData
|
|
case class AttachmentData(attachId: Ident, attachName: String) extends MatchData
|
|
case object ItemData extends MatchData
|
|
|
|
case class ItemMatch(
|
|
id: Ident,
|
|
itemId: Ident,
|
|
collectiveId: CollectiveId,
|
|
score: Double,
|
|
data: MatchData
|
|
)
|
|
}
|