Highlight class

The Atlas Search highlight option adds fields to the result set that display search terms in their original context. You can use it in conjunction with all $search operators to display search terms as they appear in the returned documents, along with the adjacent text content (if any). highlight results are returned as part of the $meta field.

Example

Expected result:

"highlight": {
   "path": ["description", "summary" ]
 }

Expected result:

 "highlight": {
   "path": "description",
   "maxNumPassages": 1,
   "maxCharsToExamine": 40
 }

https://www.mongodb.com/docs/atlas/atlas-search/highlighting

Inheritance

Constructors

Highlight({required dynamic path, int? maxCharsToExamine, int? maxNumPassages})
path - Document field to search. The path field may contain:

Properties

content ExpressionContent
no setterinherited
entry MapEntry<String, ExpressionContent>
getter/setter pairinherited
hashCode int
The hash code for this object.
no setterinherited
key String
no setterinherited
operator String
no setterinherited
rawContent → dynamic
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

build() MongoDocument
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited