retrieveByConceptIds method

List<Memory> retrieveByConceptIds(
  1. List<String> conceptIds, {
  2. int maxResults = 10,
})

Retrieves memories associated with any of the given conceptIds.

Implementation

List<Memory> retrieveByConceptIds(
  List<String> conceptIds, {
  int maxResults = 10,
}) {
  return _store.values
      .where((m) => m.associatedConceptIds
          .any((cid) => conceptIds.contains(cid)))
      .toList()
    ..sort((a, b) => b.strength.compareTo(a.strength))
    ..take(maxResults);
}