Record Class SearchResult<T>
java.lang.Object
java.lang.Record
io.micronaut.data.model.vector.search.SearchResult<T>
- Type Parameters:
T- The entity type- Record Components:
entity- The matched entityscore- The computed scoresimilarity- The normalized similarity derived from score when scoring function is known
public record SearchResult<T>(@NonNull T entity, @NonNull Score score, @Nullable Similarity similarity)
extends Record
Single vector search result containing entity, score and optional normalized similarity.
- Since:
- 5.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionSearchResult(@NonNull T entity, @NonNull Score score) Creates a search result without normalized similarity.SearchResult(@NonNull T entity, @NonNull Score score, @Nullable Similarity similarity) Creates an instance of aSearchResultrecord class. -
Method Summary
Modifier and TypeMethodDescription@NonNull Tentity()Returns the value of theentityrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@NonNull Scorescore()Returns the value of thescorerecord component.@Nullable SimilarityReturns the value of thesimilarityrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SearchResult
-
SearchResult
Creates an instance of aSearchResultrecord class.- Parameters:
entity- the value for theentityrecord componentscore- the value for thescorerecord componentsimilarity- the value for thesimilarityrecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
entity
-
score
-
similarity
Returns the value of thesimilarityrecord component.- Returns:
- the value of the
similarityrecord component
-