getKeywordsPostings method

KeywordPostingsMap getKeywordsPostings(
  1. Iterable<String> keywords
)

Filters the KeywordPostingsMap by keywords.

Returns a subset of the KeywordPostingsMap instance that only contains entires with a key in the keywords collection.

Implementation

KeywordPostingsMap getKeywordsPostings(Iterable<String> keywords) {
  final newEntries =
      entries.where((element) => keywords.contains(element.key));
  final KeywordPostingsMap retVal = {}..addEntries(newEntries);
  return retVal;
}