When I use longToString, it returns a unicode object, which when creating
a binary field doesn't seem to work:

>>> n = lucene.NumberTools.longToString(1L)
>>> n
u'00000000000001'
>>> lucene.Field('foo', n, lucene.Field.Store.YES)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
lucene.InvalidArgsError: (<type 'Field'>, '__init__', ('foo',
u'00000000000001', <Field$Store: YES>))

Converting it to a string seems to work:

>>> lucene.Field('foo', str(n), lucene.Field.Store.YES)
<Field: stored/uncompressed,binary<foo:[EMAIL PROTECTED]>>

It's relatively easy to call str on it, but I wanted to check that I
wasn't doing something wrong, since I can't find anyone else running into
this problem.

-Eric
_______________________________________________
pylucene-dev mailing list
pylucene-dev@osafoundation.org
http://lists.osafoundation.org/mailman/listinfo/pylucene-dev

Reply via email to