Skip to content

Commit

Permalink
PyLucene 7.6 supported.
Browse files Browse the repository at this point in the history
  • Loading branch information
coady committed Jan 5, 2019
1 parent 5e70a74 commit e3d8b3d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lupyne/engine/documents.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ class Field(FieldType):
properties = {name for name in locals() if not name.startswith('__')}
types = {int: 'long', float: 'double'}
types.update(NUMERIC='long', BINARY='string', SORTED='string', SORTED_NUMERIC='long', SORTED_SET='string')
dimensions = property(FieldType.pointDimensionCount, lambda self, count: self.setDimensions(count, Long.BYTES))
dimensions = property(getattr(FieldType, 'pointDataDimensionCount', getattr(FieldType, 'pointDimensionCount', None)),
lambda self, count: self.setDimensions(count, Long.BYTES))

def __init__(self, name, docValuesType='', indexOptions='', dimensions=0, **settings):
super(Field, self).__init__()
Expand Down
2 changes: 1 addition & 1 deletion lupyne/engine/indexers.py
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ def update(self, name, value='', document=(), **terms):
term = index.Term(name, *[value] if value else doc.getValues(name))
fields = list(doc.iterator())
types = [Field.cast_(field.fieldType()) for field in fields]
if any(type.stored() or type.indexOptions() != index.IndexOptions.NONE or type.pointDimensionCount() for type in types):
if any(ft.stored() or ft.indexOptions() != index.IndexOptions.NONE or Field.dimensions.fget(ft) for ft in types):
self.updateDocument(term, doc)
elif fields:
self.updateDocValues(term, *fields)
Expand Down

0 comments on commit e3d8b3d

Please sign in to comment.