Packages

o

org.mongodb.scala.model.search

SearchHighlight

object SearchHighlight

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

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

Value Members

  1. def of(highlight: Bson): SearchHighlight

    Creates a SearchHighlight from a Bson in situations when there is no builder method that better satisfies your needs.

    Creates a SearchHighlight from a Bson 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 equivalent SearchHighlights, though they may not be equal.

    val highlight1: SearchHighlight = SearchHighlight.paths(
      SearchPath.fieldPath("fieldName"),
      SearchPath.wildcardPath("wildc*rd"))
    val highlight2: SearchHighlight = SearchHighlight.of(Document("path" -> Seq(
      SearchPath.fieldPath("fieldName").toBsonValue,
      SearchPath.wildcardPath("wildc*rd").toBsonValue)))
    highlight

    A Bson representing the required SearchHighlight.

    returns

    The requested SearchHighlight.

  2. def paths(paths: Iterable[_ <: SearchPath]): SearchHighlight

    Returns a SearchHighlight for the given paths.

    Returns a SearchHighlight for the given paths.

    paths

    The non-empty fields to be searched.

    returns

    The requested SearchHighlight.

  3. def paths(path: SearchPath, paths: SearchPath*): SearchHighlight

    Returns a SearchHighlight for the given paths.

    Returns a SearchHighlight for the given paths.

    path

    The field to be searched.

    paths

    More fields to be searched.

    returns

    The requested SearchHighlight.