@@ -28,7 +28,10 @@ class InMemoryPackageIndex {
2828 late final TokenIndex <String > _readmeIndex;
2929 late final TokenIndex <IndexedApiDocPage > _apiSymbolIndex;
3030 late final _scorePool = ScorePool (_packageNameIndex._packageNames);
31- final _tagDocumentIndexes = < String , List <int >> {};
31+
32+ /// Maps the tag strings to a list of document index values
33+ /// (`PackageDocument doc.tags -> List<_documents.indexOf(doc)>` ).
34+ final _tagDocumentIndices = < String , List <int >> {};
3235 final _documentTagIds = < List <int >> [];
3336
3437 /// Adjusted score takes the overall score and transforms
@@ -63,7 +66,7 @@ class InMemoryPackageIndex {
6366 // transform tags into numberical IDs
6467 final tagIds = < int > [];
6568 for (final tag in doc.tags) {
66- _tagDocumentIndexes .putIfAbsent (tag, () => []).add (i);
69+ _tagDocumentIndices .putIfAbsent (tag, () => []).add (i);
6770 }
6871 tagIds.sort ();
6972 _documentTagIds.add (tagIds);
@@ -159,7 +162,7 @@ class InMemoryPackageIndex {
159162 query.tagsPredicate.appendPredicate (query.parsedQuery.tagsPredicate);
160163 if (combinedTagsPredicate.isNotEmpty) {
161164 for (final entry in combinedTagsPredicate.entries) {
162- final docIndexes = _tagDocumentIndexes [entry.key];
165+ final docIndexes = _tagDocumentIndices [entry.key];
163166
164167 if (entry.value) {
165168 // predicate is required, zeroing the gaps between index values
0 commit comments