ElasticResultSnippet class

An object contaning the snippet of the result

Annotations
  • @freezed

Constructors

ElasticResultSnippet({required String fullText, required List<String> textParts, required List<String> highlights})
factory
ElasticResultSnippet.fromJson(Map<String, dynamic> json)
factory

Properties

copyWith → $ElasticResultSnippetCopyWith<ElasticResultSnippet>
no setterinherited
fullText String
The full snippet, matching the size provided in the ElasticResultField passed to the query.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
highlights List<String>
The words matching the query. They can be many because even if you are querying something like "car", the result can also contain "cars". So we need to return all the words Elastic decided to match in order to highlight all the matching words.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
textParts List<String>
The snippet splitted in parts around the matched query. For example, if the document contains the string "The weather is beautiful in Florida today" and your query is "beautiful", this array will contain: "The weather is ", "beautiful", " in Florida today". This feature intends to build RichText on your app to highlight the query in the result.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
inherited
toString() String
A string representation of this object.
inherited

Operators

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