Class SearchResult.Builder
- Enclosing class:
SearchResult
-
Method Summary
Modifier and TypeMethodDescriptionadditionalProperties(Map<String, Object> additionalProperties) additionalProperty(String key, Object value) build()The exact text chunk that matched the query.contextText(String contextText) contextText(Optional<String> contextText) A broader passage surrounding the matched chunk.When the source item was created, as an ISO-8601 UTC timestamp.documentId(String documentId) documentId(Optional<String> documentId) The ID of the source document or record this chunk belongs to.externalId(String externalId) externalId(Optional<String> externalId) TheexternalIdyou supplied for the source item at ingestion, if any.from(SearchResult other) The metadata you supplied for this item when you ingested it, such as its title, folder ID, and any custom fields you included.The primary sort key — a higher value means a more relevant result — but its SCALE depends onmode.semanticScore(Double semanticScore) semanticScore(Optional<Double> semanticScore) The semantic (vector similarity) component of the score.A short excerpt with the matched query terms highlighted.sourceType(SearchResultSourceType sourceType) sourceType(Optional<SearchResultSourceType> sourceType) Indicates what kind of source item this result came from:PartnerDocumentfor documents ingested viaPOST /v1/documentsorPOST /v1/documents/upload, andGenericRecordfor typed records created viaPOST /v1/records.The keyword (BM25) relevance component of the score.
-
Method Details
-
from
-
documentId
The ID of the source document or record this chunk belongs to. Use it with
GET /v1/documents/{id}orGET /v1/records/{id}(depending onsourceType) to retrieve the full item. -
documentId
-
externalId
The
externalIdyou supplied for the source item at ingestion, if any. Null when the item was ingested without one, or when the source item was indexed before this field existed and hasn't been updated or reindexed since. -
externalId
-
score
The primary sort key — a higher value means a more relevant result — but its SCALE depends on
mode. In HYBRID mode this is a Reciprocal Rank Fusion (RRF) value: 1/(60+rank) per leg the result appears in, summed across legs, so it is small and tightly clustered (a hit ranked top on one leg scores ~0.016; ranked top on both, ~0.033) and is NOT a 0-1 confidence — don't threshold against it as one. In TEXT- or SEMANTIC-only mode, this is that engine's own native score (roughly a 0-1 cosine similarity for SEMANTIC) on a genuinely different scale — never compare scores across modes. -
score
-
textScore
The keyword (BM25) relevance component of the score. Non-zero in HYBRID mode when the keyword engine contributes to the match. In TEXT mode this is a rank-derived value reflecting the result's relative position, not a raw BM25 magnitude — treat it as meaningful for ordering within this response, not as a score comparable across requests or against other modes.
-
textScore
-
semanticScore
The semantic (vector similarity) component of the score. Non-zero when the search mode is SEMANTIC or HYBRID.
-
semanticScore
-
chunkText
The exact text chunk that matched the query. Pass this to your model as the retrieved context.
-
chunkText
-
contextText
A broader passage surrounding the matched chunk. Use this instead of
chunkTextwhen you need more context — for example to avoid fragmentation when building a long-context prompt for a model. -
contextText
-
snippet
A short excerpt with the matched query terms highlighted. Suitable for display in a search results UI.
-
snippet
-
sourceType
Indicates what kind of source item this result came from:
PartnerDocumentfor documents ingested viaPOST /v1/documentsorPOST /v1/documents/upload, andGenericRecordfor typed records created viaPOST /v1/records. Use this to branch when rendering a mix of documents and records from a unified search. -
sourceType
-
metadata
The metadata you supplied for this item when you ingested it, such as its title, folder ID, and any custom fields you included.
-
metadata
-
createdAt
When the source item was created, as an ISO-8601 UTC timestamp.
-
createdAt
-
build
-
additionalProperty
-
additionalProperties
-