original_docstring: Generate index records, based on document rows or pages.
docstring: Generate index records, based on document rows or pages.
docstring_tokens: Generate index records based on document rows or pages .
code: def generate_records(document):
      """Generate index records, based on document rows or pages."""
      q = db.session.query(DocumentRecord)
      q = q.filter(DocumentRecord.document_id == document.id)
      for idx, record in enumerate(q):
          yield {
              '_id': record.id,
              '_index': records_write_index(),
              '_type': 'doc',
              '_source': {
                  'document_id': document.id,
                  'collection_id': document.collection_id,
                  'index': record.index,
                  'text': index_form(record.texts)
              }
          }
          if idx > 0 and idx % 1000 == 0:
              log.info("Indexed [%s]: %s records...", document.id, idx)
code_tokens: def generate_records ( document ) : q = db . session . query ( DocumentRecord ) q = q . filter ( DocumentRecord . document_id == document . id ) for idx , record in enumerate ( q ) : yield { '_id' : record . id , '_index' : records_write_index ( ) , '_type' : 'doc' , '_source' : { 'document_id' : document . id , 'collection_id' : document . collection_id , 'index' : record . index , 'text' : index_form ( record . texts ) } } if idx > 0 and idx % 1000 == 0 : log . info ( "Indexed [%s]: %s records..." , document . id , idx )
short_docstring: Generate index records, based on document rows or pages.
short_docstring_tokens: Generate index records based on document rows or pages .
comment: """Generate index records, based on document rows or pages."""