Package com.mongodb.client.model.search
Interface VectorSearchNestedOptions
- All Superinterfaces:
Bson
Represents the optional
nestedOptions sub-document of the $vectorSearch pipeline stage,
used when searching against arrays of embeddings within nested (embedded) documents.- Since:
- 5.10
- See Also:
- MongoDB Atlas documentation
- $vectorSearch
- Since server release
- 8.3
-
Field Summary
Fields inherited from interface org.bson.conversions.Bson
DEFAULT_CODEC_REGISTRY -
Method Summary
Modifier and TypeMethodDescriptionCreates a newVectorSearchNestedOptionswith the specified option in situations when there is no builder method that better satisfies your needs.scoreMode(VectorSearchScoreMode scoreMode) Creates a newVectorSearchNestedOptionswith the score aggregation mode specified.static VectorSearchNestedOptionsReturnsVectorSearchNestedOptionsthat represents server defaults.Methods inherited from interface org.bson.conversions.Bson
toBsonDocument, toBsonDocument
-
Method Details
-
scoreMode
Creates a newVectorSearchNestedOptionswith the score aggregation mode specified.- Parameters:
scoreMode- The score aggregation mode for the matching embeddings within a document.- Returns:
- A new
VectorSearchNestedOptions.
-
option
Creates a newVectorSearchNestedOptionswith the specified option in situations when there is no builder method that better satisfies your needs. This method cannot be used to validate the syntax.Example
The following code creates two functionally equivalentVectorSearchNestedOptionsobjects, though they may not be equal.VectorSearchNestedOptions options1 = VectorSearchNestedOptions.vectorSearchNestedOptions() .scoreMode(VectorSearchScoreMode.AVG); VectorSearchNestedOptions options2 = VectorSearchNestedOptions.vectorSearchNestedOptions() .option("scoreMode", "avg");- Parameters:
name- The option name.value- The option value.- Returns:
- A new
VectorSearchNestedOptions.
-
vectorSearchNestedOptions
ReturnsVectorSearchNestedOptionsthat represents server defaults.- Returns:
VectorSearchNestedOptionsthat represents server defaults.
-