TextIndexer class abstract

Interface for classes that construct and maintain a InvertedIndex for a collection of documents (corpus).

Text or documents can be indexed by calling the following methods:

Implemented types
Implementers

Constructors

TextIndexer()

Properties

analyzer TextAnalyzer
The text analyser that extracts tokens from text for the index.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
k int
The length of k-gram entries in the k-gram index.
no setterinherited
nGramRange NGramRange?
The minimum and maximum length of n-grams in the index.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
vocabularyLength Future<Ft>
Returns the number of terms in the vocabulary (N).
no setterinherited
zones ZoneWeightMap
Maps zone names to their relative weight in the index.
no setterinherited

Methods

dispose() Future<void>
Cancels any stream all listeners.
getCollectionSize() Future<int>
Asynchronously returns the total number of documents in the indexed collection.
inherited
getDictionary([Iterable<String>? terms]) Future<DftMap>
Asynchronously retrieves a DftMap for the terms from a DftMap repository.
inherited
getKeywordPostings(Iterable<String> keywords) Future<KeywordPostingsMap>
Asynchronously retrieves PostingsMapEntry entities for the terms from a PostingsMap repository.
inherited
getKGramIndex(Iterable<String> kGrams) Future<KGramsMap>
Asynchronously retrieves a KGramsMap for the terms from a KGramsMap repository.
inherited
getPostings(Iterable<String> terms) Future<PostingsMap>
Asynchronously retrieves PostingsMapEntry entities for the terms from a PostingsMap repository.
inherited
indexCollection(Map<String, Map<String, dynamic>> collection, {TokenFilter? tokenFilter}) Future<void>
Indexes the InvertedIndex.zones of all the documents in collection.
indexCollectionStream(Stream<JsonCollection> collectionStream, {TokenFilter? tokenFilter}) → void
Indexes the documents emitted by collectionStream.
indexDocumentStream(Stream<MapEntry<String, JSON>> documentStream, {TokenFilter? tokenFilter}) → void
Indexes the documents emitted by documentStream.
indexJson(String docId, Map<String, dynamic> json, {TokenFilter? tokenFilter}) Future<void>
Indexes the InvertedIndex.zones in a json document, returning a list of DocPostingsMapEntry.
indexText(String docId, String docText, {String? zone, TokenFilter? tokenFilter}) Future<void>
Indexes a text document, returning a PostingsMap.
indexTokens(String docId, Iterable<Token> tokens) Future<void>
Updates the index with the tokens for docId.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
updateIndexes(PostingsMap postings, KeywordPostingsMap keywordPostings, Iterable<Token> tokens) Future<void>
The updateIndexes method updates the DftMap, PostingsMap, KeywordPostingsMap and KGramsMap.
upsertDictionary(DftMap values) Future<void>
Inserts values into a DftMap repository, overwriting them if they already exist.
inherited
upsertKeywordPostings(KeywordPostingsMap values) Future<void>
Inserts values into a PostingsMap repository, overwriting them if they already exist.
inherited
upsertKGramIndex(KGramsMap values) Future<void>
Inserts values into a KGramsMap repository, overwriting any existing entries.
inherited
upsertPostings(PostingsMap values) Future<void>
Inserts values into a PostingsMap repository, overwriting them if they already exist.
inherited

Operators

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