Packages

package search

Query building API for MongoDB Atlas full-text search.

While all the building blocks of this API, such as SearchOptions, SearchHighlight, etc., are not necessary immutable, they are unmodifiable due to methods like SearchHighlight.maxCharsToExamine returning new instances instead of modifying the instance on which they are called. This allows storing and using such instances as templates.

Since

4.7

See also

Aggregates.search

Aggregates.vectorSearch

Atlas Search

Atlas Search aggregation pipeline stages

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. search
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. type AddSearchScoreExpression = com.mongodb.client.model.search.AddSearchScoreExpression

    Annotations
    @Sealed() @Beta()
    See also

    SearchScoreExpression.addExpression

  2. type ApproximateVectorSearchOptions = com.mongodb.client.model.search.ApproximateVectorSearchOptions

    Represents optional fields of the $vectorSearch pipeline stage of an aggregation pipeline.

    Represents optional fields of the $vectorSearch pipeline stage of an aggregation pipeline.

    Configures approximate vector search for Atlas Vector Search to enable searches that may not return the exact closest vectors.

    Annotations
    @Sealed() @Beta()
    Since

    5.2

    Note

    Requires MongoDB 6.0.11, 7.0.2 or greater

    See also

    $vectorSearch

  3. type AutocompleteSearchOperator = com.mongodb.client.model.search.AutocompleteSearchOperator

    Annotations
    @Sealed() @Beta()
    See also

    SearchOperator.autocomplete(String, FieldSearchPath)

    SearchOperator.autocomplete(Iterable, FieldSearchPath)

  4. type CompoundSearchOperator = com.mongodb.client.model.search.CompoundSearchOperator

    Annotations
    @Sealed() @Beta()
    See also

    SearchOperator.compound()

  5. type CompoundSearchOperatorBase = com.mongodb.client.model.search.CompoundSearchOperatorBase

    A base for a CompoundSearchOperator which allows creating instances of this operator.

    A base for a CompoundSearchOperator which allows creating instances of this operator. This interface is a technicality and does not represent a meaningful element of the full-text search query syntax.

    Annotations
    @Sealed() @Beta()
    See also

    SearchOperator.compound()

  6. type ConstantSearchScore = com.mongodb.client.model.search.ConstantSearchScore

    Annotations
    @Sealed() @Beta()
    See also

    SearchScore.constant

  7. type ConstantSearchScoreExpression = com.mongodb.client.model.search.ConstantSearchScoreExpression

    Annotations
    @Sealed() @Beta()
    See also

    SearchScoreExpression.constantExpression

  8. type DateNearSearchOperator = com.mongodb.client.model.search.DateNearSearchOperator

    Annotations
    @Sealed() @Beta()
    See also

    SearchOperator.near

  9. type DateRangeSearchOperator = com.mongodb.client.model.search.DateRangeSearchOperator

    Annotations
    @Sealed() @Beta()
    See also

    SearchOperator.dateRange

  10. type DateRangeSearchOperatorBase = com.mongodb.client.model.search.DateRangeSearchOperatorBase

    A base for a DateRangeSearchOperatorBase which allows creating instances of this operator.

    A base for a DateRangeSearchOperatorBase which allows creating instances of this operator. This interface is a technicality and does not represent a meaningful element of the full-text search query syntax.

    Annotations
    @Sealed() @Beta()
    See also

    SearchOperator.dateRange

  11. type DateSearchFacet = com.mongodb.client.model.search.DateSearchFacet

    Annotations
    @Sealed() @Beta()
    See also

    SearchFacet.dateFacet(String, FieldSearchPath, Iterable)

  12. type ExactVectorSearchOptions = com.mongodb.client.model.search.ExactVectorSearchOptions

    Represents optional fields of the $vectorSearch pipeline stage of an aggregation pipeline.

    Represents optional fields of the $vectorSearch pipeline stage of an aggregation pipeline.

    Configures exact vector search for Atlas Vector Search to enable precise matching, ensuring that results are the closest vectors to a given query vector.

    Annotations
    @Sealed() @Beta()
    Since

    5.2

    Note

    Requires MongoDB 6.0.16, 7.0.10, 7.3.2 or greater

    See also

    $vectorSearch

  13. type ExistsSearchOperator = com.mongodb.client.model.search.ExistsSearchOperator

    Annotations
    @Sealed() @Beta()
    See also

    SearchOperator.exists(FieldSearchPath)

  14. type FacetSearchCollector = com.mongodb.client.model.search.FacetSearchCollector

    Annotations
    @Sealed() @Beta()
    See also

    SearchCollector.facet(SearchOperator, Iterable)

  15. type FieldSearchPath = com.mongodb.client.model.search.FieldSearchPath

    Annotations
    @Sealed() @Beta()
    See also

    SearchPath.fieldPath(String)

  16. type FilterCompoundSearchOperator = com.mongodb.client.model.search.FilterCompoundSearchOperator

    A representation of a CompoundSearchOperator that allows changing filter-specific options, if any.

    A representation of a CompoundSearchOperator that allows changing filter-specific options, if any. This interface is a technicality and does not represent a meaningful element of the full-text search query syntax.

    Annotations
    @Sealed() @Beta()
    See also

    CompoundSearchOperatorBase.filter(Iterable)

  17. type FunctionSearchScore = com.mongodb.client.model.search.FunctionSearchScore

    Annotations
    @Sealed() @Beta()
    See also

    SearchScore.function

  18. type FuzzySearchOptions = com.mongodb.client.model.search.FuzzySearchOptions

    Fuzzy search options that may be used with some SearchOperators.

    Fuzzy search options that may be used with some SearchOperators.

    Annotations
    @Sealed() @Beta()
    See also

    autocomplete operator

    text operator

  19. type GaussSearchScoreExpression = com.mongodb.client.model.search.GaussSearchScoreExpression

    Annotations
    @Sealed() @Beta()
    See also

    SearchScoreExpression.gaussExpression

  20. type GeoNearSearchOperator = com.mongodb.client.model.search.GeoNearSearchOperator

    Annotations
    @Sealed() @Beta()
    See also

    SearchOperator.near

  21. type Log1pSearchScoreExpression = com.mongodb.client.model.search.Log1pSearchScoreExpression

    Annotations
    @Sealed() @Beta()
    See also

    SearchScoreExpression.log1p

  22. type LogSearchScoreExpression = com.mongodb.client.model.search.LogSearchScoreExpression

    Annotations
    @Sealed() @Beta()
    See also

    SearchScoreExpression.log

  23. type LowerBoundSearchCount = com.mongodb.client.model.search.LowerBoundSearchCount

    Annotations
    @Sealed() @Beta()
    See also

    SearchCount.lowerBound()

  24. type MultiplySearchScoreExpression = com.mongodb.client.model.search.MultiplySearchScoreExpression

    Annotations
    @Sealed() @Beta()
    See also

    SearchScoreExpression.multiplyExpression

  25. type MustCompoundSearchOperator = com.mongodb.client.model.search.MustCompoundSearchOperator

    A representation of a CompoundSearchOperator that allows changing must-specific options, if any.

    A representation of a CompoundSearchOperator that allows changing must-specific options, if any. This interface is a technicality and does not represent a meaningful element of the full-text search query syntax.

    Annotations
    @Sealed() @Beta()
    See also

    CompoundSearchOperatorBase.must(Iterable)

  26. type MustNotCompoundSearchOperator = com.mongodb.client.model.search.MustNotCompoundSearchOperator

    A representation of a CompoundSearchOperator that allows changing mustNot-specific options, if any.

    A representation of a CompoundSearchOperator that allows changing mustNot-specific options, if any. This interface is a technicality and does not represent a meaningful element of the full-text search query syntax.

    Annotations
    @Sealed() @Beta()
    See also

    CompoundSearchOperatorBase.mustNot(Iterable)

  27. type NumberNearSearchOperator = com.mongodb.client.model.search.NumberNearSearchOperator

    Annotations
    @Sealed() @Beta()
    See also

    SearchOperator.near

  28. type NumberRangeSearchOperator = com.mongodb.client.model.search.NumberRangeSearchOperator

    Annotations
    @Sealed() @Beta()
    See also

    SearchOperator.numberRange

  29. type NumberRangeSearchOperatorBase = com.mongodb.client.model.search.NumberRangeSearchOperatorBase

    A base for a NumberRangeSearchOperatorBase which allows creating instances of this operator.

    A base for a NumberRangeSearchOperatorBase which allows creating instances of this operator. This interface is a technicality and does not represent a meaningful element of the full-text search query syntax.

    Annotations
    @Sealed() @Beta()
    See also

    SearchOperator.numberRange

  30. type NumberSearchFacet = com.mongodb.client.model.search.NumberSearchFacet

    Annotations
    @Sealed() @Beta()
    See also

    SearchFacet.numberFacet(String, FieldSearchPath, Iterable)

  31. type PathBoostSearchScore = com.mongodb.client.model.search.PathBoostSearchScore

    Annotations
    @Sealed() @Beta()
    See also

    SearchScore.boost(FieldSearchPath)

  32. type PathSearchScoreExpression = com.mongodb.client.model.search.PathSearchScoreExpression

    Annotations
    @Sealed() @Beta()
    See also

    SearchScoreExpression.pathExpression

  33. type RelevanceSearchScoreExpression = com.mongodb.client.model.search.RelevanceSearchScoreExpression

    Annotations
    @Sealed() @Beta()
    See also

    SearchScoreExpression.relevanceExpression

  34. type SearchCollector = com.mongodb.client.model.search.SearchCollector

    The core part of the $search pipeline stage of an aggregation pipeline.

    The core part of the $search pipeline stage of an aggregation pipeline. SearchCollectors allow returning metadata together with the matching search results. You may use the $$SEARCH_META variable, e.g., via Projections.computedSearchMeta, to extract this metadata.

    Annotations
    @Sealed() @Beta()
    See also

    Search collectors

  35. type SearchCount = com.mongodb.client.model.search.SearchCount

    Counting options.

    Counting options. You may use the $$SEARCH_META variable, e.g., via Projections.computedSearchMeta, to extract the results of counting. You may use Projections.computedSearchMeta to extract the count results.

    Annotations
    @Sealed() @Beta()
    See also

    Counting

  36. type SearchFacet = com.mongodb.client.model.search.SearchFacet

    A facet definition for FacetSearchCollector.

    A facet definition for FacetSearchCollector.

    Annotations
    @Sealed() @Beta()
    See also

    Facet definition

  37. type SearchHighlight = com.mongodb.client.model.search.SearchHighlight

    Highlighting options.

    Highlighting options. You may use the $meta: "searchHighlights" expression, e.g., via Projections.metaSearchHighlights, to extract the results of highlighting.

    Annotations
    @Sealed() @Beta()
    See also

    Highlighting

  38. type SearchOperator = com.mongodb.client.model.search.SearchOperator

    The core part of the $search pipeline stage of an aggregation pipeline.

    The core part of the $search pipeline stage of an aggregation pipeline.

    Annotations
    @Sealed() @Beta()
    See also

    Search operators

  39. type SearchOptions = com.mongodb.client.model.search.SearchOptions

    Represents optional fields of the $search pipeline stage of an aggregation pipeline.

    Represents optional fields of the $search pipeline stage of an aggregation pipeline.

    Annotations
    @Sealed() @Beta()
    See also

    $search syntax

  40. type SearchPath = com.mongodb.client.model.search.SearchPath

    A specification of fields to be searched.

    A specification of fields to be searched.

    Despite SearchPath being Bson, its value conforming to the correct syntax must be obtained via either SearchPath.toBsonValue or FieldSearchPath.toValue.

    Annotations
    @Sealed() @Beta()
    See also

    Path

  41. type SearchScore = com.mongodb.client.model.search.SearchScore

    A modifier of the relevance score.

    A modifier of the relevance score. You may use the $meta: "searchScore" expression, e.g., via Projections.metaSearchScore, to extract the relevance score assigned to each found document.

    Annotations
    @Sealed() @Beta()
    See also

    Scoring

  42. type SearchScoreExpression = com.mongodb.client.model.search.SearchScoreExpression

    Annotations
    @Sealed() @Beta()
    See also

    SearchScore.function

    Expressions for the function score modifier

  43. type ShouldCompoundSearchOperator = com.mongodb.client.model.search.ShouldCompoundSearchOperator

    A representation of a CompoundSearchOperator that allows changing should-specific options, if any.

    A representation of a CompoundSearchOperator that allows changing should-specific options, if any. This interface is a technicality and does not represent a meaningful element of the full-text search query syntax.

    Annotations
    @Sealed() @Beta()
    See also

    CompoundSearchOperatorBase.should(Iterable)

  44. type StringSearchFacet = com.mongodb.client.model.search.StringSearchFacet

    Annotations
    @Sealed() @Beta()
    See also

    SearchFacet.stringFacet(String, FieldSearchPath)

  45. type TextSearchOperator = com.mongodb.client.model.search.TextSearchOperator

    Annotations
    @Sealed() @Beta()
    See also

    SearchOperator.text(String, SearchPath)

    SearchOperator.text(Iterable, Iterable)

  46. type TotalSearchCount = com.mongodb.client.model.search.TotalSearchCount

    Annotations
    @Sealed() @Beta()
    See also

    SearchCount.total()

  47. type ValueBoostSearchScore = com.mongodb.client.model.search.ValueBoostSearchScore

    Annotations
    @Sealed() @Beta()
    See also

    SearchScore.boost(float)

  48. type VectorSearchOptions = com.mongodb.client.model.search.VectorSearchOptions

    Represents optional fields of the $vectorSearch pipeline stage of an aggregation pipeline.

    Represents optional fields of the $vectorSearch pipeline stage of an aggregation pipeline.

    Annotations
    @Sealed() @Beta()
    Since

    4.11

    Note

    Requires MongoDB 6.0.11 or greater

    See also

    $vectorSearch

  49. type WildcardSearchPath = com.mongodb.client.model.search.WildcardSearchPath

    Annotations
    @Sealed() @Beta()
    See also

    SearchPath.wildcardPath(String)

Value Members

  1. object FuzzySearchOptions

    Fuzzy search options that may be used with some SearchOperators.

    Fuzzy search options that may be used with some SearchOperators.

    Annotations
    @Beta()
    Since

    4.7

    See also

    autocomplete operator

    text operator

  2. object SearchCollector

    The core part of the $search pipeline stage of an aggregation pipeline.

    The core part of the $search pipeline stage of an aggregation pipeline. SearchCollectors allow returning metadata together with the matching search results. You may use the $$SEARCH_META variable, e.g., via Projections.computedSearchMeta, to extract this metadata.

    Annotations
    @Beta()
    Since

    4.7

    See also

    Search collectors

  3. object SearchCount

    Counting options.

    Counting options. You may use the $$SEARCH_META variable, e.g., via Projections.computedSearchMeta, to extract the results of counting.

    Annotations
    @Beta()
    Since

    4.7

    See also

    Counting

  4. object SearchFacet

    A facet definition for FacetSearchCollector.

    A facet definition for FacetSearchCollector.

    Annotations
    @Beta()
    Since

    4.7

    See also

    Facet definition

  5. object SearchHighlight

    Highlighting options.

    Highlighting options. You may use the $meta: "searchHighlights" expression, e.g., via Projections.metaSearchHighlights, to extract the results of highlighting.

    Annotations
    @Beta()
    Since

    4.7

    See also

    Highlighting

  6. object SearchOperator

    The core part of the $search pipeline stage of an aggregation pipeline.

    The core part of the $search pipeline stage of an aggregation pipeline.

    Annotations
    @Beta()
    Since

    4.7

    See also

    Search operators

  7. object SearchOptions

    Represents optional fields of the $search pipeline stage of an aggregation pipeline.

    Represents optional fields of the $search pipeline stage of an aggregation pipeline.

    Annotations
    @Beta()
    Since

    4.7

    See also

    $search syntax

  8. object SearchPath

    A specification of fields to be searched.

    A specification of fields to be searched.

    Depending on the context, one of the following methods may be used to get a representation of a SearchPath with the correct syntax: SearchPath.toBsonDocument, SearchPath.toBsonValue, FieldSearchPath.toValue.

    Annotations
    @Beta()
    Since

    4.7

    See also

    Path

  9. object SearchScore

    A modifier of the relevance score.

    A modifier of the relevance score. You may use the $meta: "searchScore" expression, e.g., via Projections.metaSearchScore, to extract the relevance score assigned to each found document.

    Annotations
    @Beta()
    Since

    4.7

    See also

    Scoring

  10. object SearchScoreExpression

  11. object VectorSearchOptions

    Represents optional fields of the $vectorSearch pipeline stage of an aggregation pipeline.

    Represents optional fields of the $vectorSearch pipeline stage of an aggregation pipeline.

    Since

    4.11

    Note

    Requires MongoDB 6.0.11, or greater

    See also

    $vectorSearch

Inherited from AnyRef

Inherited from Any

Ungrouped