AsyncCallbackIndex class
The AsyncCallbackIndex is a InvertedIndex implementation class that extends AsyncCallbackIndexBase.
The AsyncCallbackIndex is intended for working with a larger corpus and an asynchronous index repository in persisted storage. It uses asynchronous callbacks to perform read and write operations on DftMap, KGramsMap and PostingsMap repositories.
- Inheritance
-
- Object
- AsyncCallbackIndexBase
- AsyncCallbackIndex
Constructors
- AsyncCallbackIndex({required CollectionSizeCallback collectionSizeLoader, required DftMapLoader dictionaryLoader, required DftMapUpdater dictionaryUpdater, required CollectionSizeCallback dictionaryLengthLoader, required KGramsMapLoader kGramIndexLoader, required KGramsMapUpdater kGramIndexUpdater, required PostingsMapLoader postingsLoader, required PostingsMapUpdater postingsUpdater, required KeywordPostingsMapLoader keywordPostingsLoader, required KeywordPostingsMapUpdater keywordPostingsUpdater, required TextAnalyzer analyzer, int k = 2, NGramRange? nGramRange, ZoneWeightMap zones = const <String, double>{}})
- Instantiates a AsyncCallbackIndex instance:
Properties
- analyzer → TextAnalyzer
-
The text analyser that extracts tokens from text for the index.
final
- collectionSizeLoader → CollectionSizeCallback
-
Asynchronously retrieves the number of documents in the indexed
collection.
final
- dictionaryLengthLoader → CollectionSizeCallback
-
Asynchronously retrieves the number of terms in the vocabulary.
final
- dictionaryLoader → DftMapLoader
-
Asynchronously retrieves a DftMap subset for a vocabulary from a
DftMap index repository, usually persisted storage.
final
- dictionaryUpdater → DftMapUpdater
-
A callback that passes a subset of a DftMap containing new or
changed DftMapEntry instances for persisting to the DftMap
index repository.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- k → int
-
The length of k-gram entries in the k-gram index.
final
- keywordPostingsLoader → KeywordPostingsMapLoader
-
Asynchronously retrieves a PostingsMap subset for a vocabulary from a
PostingsMap index repository, usually persisted storage.
final
- keywordPostingsUpdater → KeywordPostingsMapUpdater
-
A callback that passes a subset of a PostingsMap containing new or changed
PostingsMapEntry instances to the PostingsMap index repository.
final
- kGramIndexLoader → KGramsMapLoader
-
Asynchronously retrieves a KGramsMap subset for a vocabulary from a
KGramsMap index repository, usually persisted storage.
final
- kGramIndexUpdater → KGramsMapUpdater
-
A callback that passes a subset of a KGramsMap containing new or
changed entries for persisting to the KGramsMap repository.
final
- nGramRange → NGramRange?
-
The minimum and maximum length of n-grams in the index.
final
- postingsLoader → PostingsMapLoader
-
Asynchronously retrieves a PostingsMap subset for a vocabulary from a
PostingsMap index repository, usually persisted storage.
final
- postingsUpdater → PostingsMapUpdater
-
A callback that passes a subset of a PostingsMap containing new or changed
PostingsMapEntry instances to the PostingsMap index repository.
final
- 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 setteroverride
- zones → ZoneWeightMap
-
Maps zone names to their relative weight in the index.
final
Methods
-
dispose(
) → Future< void> -
Cancels any stream all listeners.
inherited
-
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> ? terms]) → 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< collection, {TokenFilter? tokenFilter}) → Future<String, dynamic> >void> -
Implementation of TextIndexer.indexCollection that parses each Map<String, dynamic>
document in
collection
to Tokens and maps the tokens to a PostingsMap that is passed to updateIndexes.inherited -
indexCollectionStream(
Stream< JsonCollection> collectionStream, {TokenFilter? tokenFilter}) → void -
Indexes the documents emitted by
collectionStream
.inherited -
indexDocumentStream(
Stream< MapEntry< documentStream, {TokenFilter? tokenFilter}) → voidString, JSON> > -
Indexes the documents emitted by
documentStream
.inherited -
indexJson(
String docId, Map< String, dynamic> json, {TokenFilter? tokenFilter}) → Future<void> -
Implementation of TextIndexer.indexJson that:
inherited
-
indexText(
String docId, String docText, {bool preserveCase = false, String? zone, TokenFilter? tokenFilter}) → Future< void> -
Implementation of TextIndexer.indexText that:
inherited
-
indexTokens(
String docId, Iterable< Token> tokens) → Future<void> -
Updates the index with the
tokens
fordocId
.inherited -
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> -
Implementation of TextIndexer.updateIndexes.
inherited
-
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