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).externalId(String externalId) The externalId you supplied for the source item at ingestion, if any.externalId(Optional<String> externalId) The externalId you supplied for the source item at ingestion, if any.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. 0 (not null) when this match came from keyword search only.semanticScore(Optional<Double> semanticScore) The cosine-similarity score from semantic (vector) search, from 0 to 1. 0 (not null) when this match came from keyword search only.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 relevance component of the score.The keyword relevance component of the score.
-
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. 0 (not 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. 0 (not null) when this match came from keyword search only.
- Specified by:
semanticScorein interfaceRagSearchResult._FinalStage
-
textScore
The keyword relevance component of the score. Non-zero in HYBRID mode when the keyword engine contributes to the match, and in TEXT mode. In TEXT mode this is a rank-derived value reflecting the result's relative position, not a normalized BM25 magnitude — meaningful for ordering within this response, not comparable across requests or against HYBRID/SEMANTIC scores. 0 (not 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 relevance component of the score. Non-zero in HYBRID mode when the keyword engine contributes to the match, and in TEXT mode. In TEXT mode this is a rank-derived value reflecting the result's relative position, not a normalized BM25 magnitude — meaningful for ordering within this response, not comparable across requests or against HYBRID/SEMANTIC scores. 0 (not null) when this match came from semantic search only.
- Specified by:
textScorein interfaceRagSearchResult._FinalStage
-
externalId
The externalId you supplied for the source item at ingestion, if any. Null when the item was ingested without one, or when it was indexed before this field existed and hasn't been updated or reindexed since.
- Specified by:
externalIdin interfaceRagSearchResult._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
externalId
The externalId you supplied for the source item at ingestion, if any. Null when the item was ingested without one, or when it was indexed before this field existed and hasn't been updated or reindexed since.
- Specified by:
externalIdin interfaceRagSearchResult._FinalStage
-
build
- Specified by:
buildin interfaceRagSearchResult._FinalStage
-
additionalProperty
- Specified by:
additionalPropertyin interfaceRagSearchResult._FinalStage
-
additionalProperties
- Specified by:
additionalPropertiesin interfaceRagSearchResult._FinalStage
-