Class RagSearchResult.Builder
- All Implemented Interfaces:
RagSearchResult._FinalStage,RagSearchResult.DocumentIdStage,RagSearchResult.ScoreStage
- Enclosing class:
RagSearchResult
-
Method Summary
Modifier and TypeMethodDescriptionadditionalProperties(Map<String, Object> additionalProperties) additionalProperty(String key, Object value) build()The specific chunk of text that matched the query — the narrowest snippet, useful for citation.The specific chunk of text that matched the query — the narrowest snippet, useful for citation.contextText(String contextText) The wider surrounding passage supplied to the model as context — broader thanchunkTextto better ground the answer.contextText(Optional<String> contextText) The wider surrounding passage supplied to the model as context — broader thanchunkTextto better ground the answer.createdAt(OffsetDateTime createdAt) The result's creation timestamp, as an ISO-8601 UTC timestamp.createdAt(Optional<OffsetDateTime> createdAt) The result's creation timestamp, as an ISO-8601 UTC timestamp.documentId(@NotNull String documentId) The stable identifier of the matched result (a document or a record).from(RagSearchResult other) Metadata you supplied on the source document, such as its title, folder id, or custom tags.Metadata you supplied on the source document, such as its title, folder id, or custom tags.score(double score) The combined relevance score from hybrid ranking.semanticScore(Double semanticScore) The cosine-similarity score from semantic (vector) search, from 0 to 1.semanticScore(Optional<Double> semanticScore) The cosine-similarity score from semantic (vector) search, from 0 to 1.A display-ready snippet with the matched query terms emphasized — suitable for search-result UIs.A display-ready snippet with the matched query terms emphasized — suitable for search-result UIs.The keyword (BM25) relevance score, from 0 to 1.The keyword (BM25) relevance score, from 0 to 1.
-
Method Details
-
from
- Specified by:
fromin interfaceRagSearchResult.DocumentIdStage
-
documentId
The stable identifier of the matched result (a document or a record).
The stable identifier of the matched result (a document or a record).
- Specified by:
documentIdin interfaceRagSearchResult.DocumentIdStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
score
The combined relevance score from hybrid ranking. Higher is more relevant.
The combined relevance score from hybrid ranking. Higher is more relevant.
- Specified by:
scorein interfaceRagSearchResult.ScoreStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
createdAt
The result's creation timestamp, as an ISO-8601 UTC timestamp.
- Specified by:
createdAtin interfaceRagSearchResult._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
createdAt
The result's creation timestamp, as an ISO-8601 UTC timestamp.
- Specified by:
createdAtin interfaceRagSearchResult._FinalStage
-
metadata
Metadata you supplied on the source document, such as its title, folder id, or custom tags.
- Specified by:
metadatain interfaceRagSearchResult._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
metadata
Metadata you supplied on the source document, such as its title, folder id, or custom tags.
- Specified by:
metadatain interfaceRagSearchResult._FinalStage
-
snippet
A display-ready snippet with the matched query terms emphasized — suitable for search-result UIs.
- Specified by:
snippetin interfaceRagSearchResult._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
snippet
A display-ready snippet with the matched query terms emphasized — suitable for search-result UIs.
- Specified by:
snippetin interfaceRagSearchResult._FinalStage
-
contextText
The wider surrounding passage supplied to the model as context — broader than
chunkTextto better ground the answer.- Specified by:
contextTextin interfaceRagSearchResult._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
contextText
The wider surrounding passage supplied to the model as context — broader than
chunkTextto better ground the answer.- Specified by:
contextTextin interfaceRagSearchResult._FinalStage
-
chunkText
The specific chunk of text that matched the query — the narrowest snippet, useful for citation.
- Specified by:
chunkTextin interfaceRagSearchResult._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
chunkText
The specific chunk of text that matched the query — the narrowest snippet, useful for citation.
- Specified by:
chunkTextin interfaceRagSearchResult._FinalStage
-
semanticScore
The cosine-similarity score from semantic (vector) search, from 0 to 1. Null when this match came from keyword search only.
- Specified by:
semanticScorein interfaceRagSearchResult._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
semanticScore
The cosine-similarity score from semantic (vector) search, from 0 to 1. Null when this match came from keyword search only.
- Specified by:
semanticScorein interfaceRagSearchResult._FinalStage
-
textScore
The keyword (BM25) relevance score, from 0 to 1. Null when this match came from semantic search only.
- Specified by:
textScorein interfaceRagSearchResult._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
textScore
The keyword (BM25) relevance score, from 0 to 1. Null when this match came from semantic search only.
- Specified by:
textScorein interfaceRagSearchResult._FinalStage
-
build
- Specified by:
buildin interfaceRagSearchResult._FinalStage
-
additionalProperty
- Specified by:
additionalPropertyin interfaceRagSearchResult._FinalStage
-
additionalProperties
- Specified by:
additionalPropertiesin interfaceRagSearchResult._FinalStage
-