original_docstring: Scan all records matching the given criteria.
docstring: Scan all records matching the given criteria.
docstring_tokens: Scan all records matching the given criteria .
code: def iter_records(document_id=None, collection_id=None):
      """Scan all records matching the given criteria."""
      filters = []
      if document_id is not None:
          filters.append({'term': {'document_id': document_id}})
      if collection_id is not None:
          filters.append({'term': {'collection_id': collection_id}})
      query = {'query': {'bool': {'filter': filters}}}
      index = records_read_index()
      for res in scan(es, index=index, query=query, scroll='1410m'):
          record = unpack_result(res)
          if record is not None:
              yield record
code_tokens: def iter_records ( document_id = None , collection_id = None ) : filters = [ ] if document_id is not None : filters . append ( { 'term' : { 'document_id' : document_id } } ) if collection_id is not None : filters . append ( { 'term' : { 'collection_id' : collection_id } } ) query = { 'query' : { 'bool' : { 'filter' : filters } } } index = records_read_index ( ) for res in scan ( es , index = index , query = query , scroll = '1410m' ) : record = unpack_result ( res ) if record is not None : yield record
short_docstring: Scan all records matching the given criteria.
short_docstring_tokens: Scan all records matching the given criteria .
comment: """Scan all records matching the given criteria."""