code: def search_list(kb, value=None, match_type=None,
                      page=None, per_page=None, unique=False):
          
          # init
          page = page or 1
          per_page = per_page or 10
  
          if kb.kbtype == models.KnwKB.KNWKB_TYPES['written_as']:
              # get the base query
              query = api.query_kb_mappings(
                  kbid=kb.id,
                  value=value or '',
                  match_type=match_type or 's'
              ).with_entities(models.KnwKBRVAL.m_value)
              # if you want a 'unique' list
              if unique:
                  query = query.distinct()
              # run query and paginate
              return [item.m_value for item in
                      pagination.RestfulSQLAlchemyPagination(
                          query, page=page or 1,
                          per_page=per_page or 10
                      ).items]
          elif kb.kbtype == models.KnwKB.KNWKB_TYPES['dynamic']:
              items = api.get_kbd_values(kb.name, value)
              return pagination.RestfulPagination(
                  page=page, per_page=per_page,
                  total_count=len(items)
              ).slice(items)
          return []
docs: Search "mappings to" for knowledge.