Skip to content

Commit

Permalink
fix pacifica#15 update size to be elasticsearch long
Browse files Browse the repository at this point in the history
This should make the size field of a file a long for elasticsearch
matching the BigIntegerField peewee type.
  • Loading branch information
dmlb2000 committed Apr 24, 2017
1 parent 995c6c5 commit 23ec611
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions metadata/orm/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ class Files(CherryPyAPI):
def elastic_mapping_builder(obj):
"""Build the elasticsearch mapping bits."""
super(Files, Files).elastic_mapping_builder(obj)
obj['transaction_id'] = obj['size'] = \
{'type': 'integer'}
obj['transaction_id'] = {'type': 'integer'}
obj['size'] = {'type': 'long'}
obj['ctime'] = obj['mtime'] = \
{'type': 'date', 'format': 'yyyy-mm-dd\'T\'HH:mm:ss'}
obj['name'] = obj['subdir'] = obj['mimetype'] = \
Expand Down
2 changes: 1 addition & 1 deletion test_files/files.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"mimetype": "text/plain",
"mtime": "Sat Nov 12 21:38:21 2016",
"name": "bar.txt",
"size": 234,
"size": 3221225472,
"subdir": "a/b",
"transaction_id": 67
}
Expand Down

0 comments on commit 23ec611

Please sign in to comment.