1.1 --- a/iixr/fields.py Fri Sep 18 01:39:08 2009 +0200
1.2 +++ b/iixr/fields.py Fri Sep 18 21:07:35 2009 +0200
1.3 @@ -33,11 +33,8 @@
1.4 """
1.5 Write for the given 'docnum', a list of 'fields' (integer, string pairs
1.6 representing field identifiers and values respectively).
1.7 - Return the offset at which the fields are stored.
1.8 """
1.9
1.10 - offset = self.f.tell()
1.11 -
1.12 # Write the document number delta.
1.13
1.14 self.write_number(docnum - self.last_docnum)
1.15 @@ -53,7 +50,6 @@
1.16 self.write_string(field, 1) # compress
1.17
1.18 self.last_docnum = docnum
1.19 - return offset
1.20
1.21 class FieldReader(FileReader):
1.22
1.23 @@ -159,10 +155,12 @@
1.24
1.25 "Write details of the document with the given 'docnum' and 'fields'."
1.26
1.27 - offset = self.field_writer.write_fields(docnum, fields)
1.28 -
1.29 if self.entry % self.interval == 0:
1.30 + offset = self.field_writer.f.tell()
1.31 + self.field_writer.write_fields(docnum, fields)
1.32 self.field_index_writer.write_document(docnum, offset)
1.33 + else:
1.34 + self.field_writer.write_fields(docnum, fields)
1.35
1.36 self.entry += 1
1.37