Skip to content

Commit

Permalink
Added properties map to QueryResultRetrievable
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaro committed Dec 11, 2023
1 parent 8c6019c commit 84d94f6
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ import org.vitrivr.engine.core.model.retrievable.Retrieved
typealias RetrievableIdString = String

@Serializable
data class QueryResultRetrievable(val id: RetrievableIdString, val score: Float, val type: String, val parts: MutableList<RetrievableIdString>) {
data class QueryResultRetrievable(val id: RetrievableIdString, val score: Float, val type: String, val parts: MutableList<RetrievableIdString>, val properties: Map<String, String>) {
constructor(retrieved: Retrieved) : this(
retrieved.id.toString(),
if (retrieved is Retrieved.RetrievedWithScore) retrieved.score else 0f,
retrieved.type ?: "",
mutableListOf()
mutableListOf(),
if (retrieved is Retrieved.RetrievedWithProperties) retrieved.properties else emptyMap()
)
}

0 comments on commit 84d94f6

Please sign in to comment.