Builder class
Builder performs indexing on a set of documents and returns instances of Index ready for querying.
All configuration of the index is done via the builder, the fields to index, the document reference, the text processing pipeline and document scoring parameters are all set on the builder before indexing.
Constructors
- Builder()
Properties
-
averageFieldLength
↔ Map<
String, double> -
getter/setter pair
- b ↔ double
-
A parameter to tune the amount of field length normalisation that is applied when
calculating relevance scores. A value of 0 will completely disable any normalisation
and a value of 1 will fully normalise field lengths. The default is 0.75. Values of b
will be clamped to the range 0 - 1.
getter/setter pair
- documentCount ↔ int
-
Keeps track of the total number of documents indexed.
getter/setter pair
- documents → dynamic
-
no setter
-
fieldLengths
↔ Map<
FieldRef, int> -
Keeps track of the length of documents added to the index.
getter/setter pair
- fields → dynamic
-
no setter
- fieldTermFrequencies ↔ FieldTermFrequencies
-
Keeps track of document term frequencies.
getter/setter pair
-
fieldVectors
↔ Map<
FieldRef, Vector> -
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- invertedIndex ↔ InvertedIndex
-
The inverted index maps terms to document fields.
getter/setter pair
- k1 ↔ double
-
A parameter that controls the speed at which a rise in term frequency results in term
frequency saturation. The default value is 1.2. Setting this to a higher value will give
slower saturation levels, a lower value will result in quicker saturation.
getter/setter pair
-
metadataWhitelist
↔ List<
String> -
A list of metadata keys that have been whitelisted for entry in the index.
getter/setter pair
- pipeline ↔ Pipeline
-
The pipeline performs text processing on tokens before indexing.
getter/setter pair
- ref ↔ String
-
Internal reference to the document reference field.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- searchPipeline ↔ Pipeline
-
A pipeline for processing search terms before querying the index.
getter/setter pair
- termIndex ↔ int
-
A counter incremented for each unique term, used to identify a terms position in the vector space.
getter/setter pair
- tokenizer ↔ Tokenizer
-
Function for splitting strings into tokens for indexing.
getter/setter pair
- tokenSet ↔ TokenSet
-
getter/setter pair
Methods
-
add(
Map< String, dynamic> doc, [Map<String, dynamic> ? attributes]) → dynamic - Adds a document to the index.
-
build(
) → Index - Builds the index, creating an instance of Index.
-
field(
String fieldName, [FieldMapping? attributes]) → dynamic - Adds a field to the list of document fields that will be indexed. Every document being indexed should have this field. Null values for this field in indexed documents will not cause errors but will limit the chance of that document being retrieved by searches.
-
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