Skip to content

Commit

Permalink
Handy fun 'getMetadata(key: String)' introduce for Match data holder.
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbanda committed May 16, 2023
1 parent a122ba1 commit c2b2e8c
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ case class QueryResponse(
case class Match(
id: String,
score: Double,
values: Seq[Double], // not returned when includeValues = false
values: Seq[Double], // not returned when includeValues = false
sparseValues: Option[SparseVector],
metadata: Option[Map[String, String]] // not returned when includeMetadata = true
)
metadata: Option[Map[String, String]] // not returned when includeMetadata = false
) {
val metadataUnwrapped : Map[String, String] = metadata.getOrElse(Map[String, String]())
def getMetadata(key: String): Option[String] = metadataUnwrapped.get(key)
}

0 comments on commit c2b2e8c

Please sign in to comment.