Index class

An index contains the built index of all documents and provides a query interface to the index.

Usually instances of lunr.Index will not be created using this constructor, instead lunr.Builder should be used to construct new indexes, or lunr.Index.load should be used to load previously built and serialized indexes.

invertedIndex - An index of term/field to document reference. fieldVectors - Field vectors tokenSet - An set of all corpus tokens. fields - The names of indexed document fields. pipeline - The pipeline to use for search terms.

Constructors

Index({required InvertedIndex invertedIndex, required Map<FieldRef, Vector> fieldVectors, required TokenSet tokenSet, required List<String> fields, required Pipeline pipeline})
Index.fromJson(Map<String, dynamic> map)
factory
Index.load(Map<String, dynamic> map)
Loads a previously serialized lunr.Index
factory

Properties

fields List<String>
getter/setter pair
fieldVectors Map<FieldRef, Vector>
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
invertedIndex InvertedIndex
getter/setter pair
pipeline Pipeline
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tokenSet TokenSet
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
query(QueryCallback fn) List<DocMatch>
Performs a query against the index using the yielded lunr.Query object.
Performs a search against the index using lunr query syntax.
toJSON() Map<String, dynamic>
Prepares the index for JSON serialization.
toJson() Map<String, dynamic>
toString() String
A string representation of this object.
inherited

Operators

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