-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add eitem_type field to EItem and 'MULTIMEDIA' to DOCUMENT_TYPES #1207
Changes from all commits
d8d5909
43ddde8
e7d84e9
9eb2db2
1f52bbf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,8 +57,14 @@ def validate(self, record, **kwargs): | |
class EItem(IlsRecord): | ||
"""EItem record class.""" | ||
|
||
EITEM_TYPES = [ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not a strong opinion, I would like to also check with the others (could you discuss on a standup?): would it be more flexible to store these types in a vocabulary? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, I will discuss |
||
"E-BOOK", | ||
"AUDIOBOOK", | ||
"VIDEO", | ||
] | ||
|
||
_pid_type = EITEM_PID_TYPE | ||
_schema = "eitems/eitem-v1.0.0.json" | ||
_schema = "eitems/eitem-v2.0.0.json" | ||
_document_resolver_path = ( | ||
"{scheme}://{host}/api/resolver/eitems/{eitem_pid}/document" | ||
) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
{ | ||
"mappings": { | ||
"date_detection": false, | ||
"numeric_detection": false, | ||
"properties": { | ||
"$schema": { | ||
"type": "keyword" | ||
}, | ||
"_created": { | ||
"type": "date" | ||
}, | ||
"_updated": { | ||
"type": "date" | ||
}, | ||
"bucket_id": { | ||
"type": "keyword" | ||
}, | ||
"created_by": { | ||
"properties": { | ||
"type": { | ||
"type": "keyword" | ||
}, | ||
"value": { | ||
"type": "keyword" | ||
} | ||
}, | ||
"type": "object" | ||
}, | ||
"description": { | ||
"type": "text" | ||
}, | ||
"document": { | ||
"properties": { | ||
"authors": { | ||
"type": "text" | ||
}, | ||
"cover_metadata": { | ||
"properties": {}, | ||
"type": "object" | ||
}, | ||
"edition": { | ||
"type": "text" | ||
}, | ||
"pid": { | ||
"type": "keyword" | ||
}, | ||
"publication_year": { | ||
"type": "keyword" | ||
}, | ||
"title": { | ||
"type": "text", | ||
"fields": { | ||
"keyword": { | ||
"type": "keyword" | ||
} | ||
} | ||
} | ||
}, | ||
"type": "object" | ||
}, | ||
"document_pid": { | ||
"type": "keyword" | ||
}, | ||
"eitem_type": { | ||
"type": "keyword" | ||
}, | ||
"files": { | ||
"properties": { | ||
"bucket": { | ||
"type": "keyword" | ||
}, | ||
"checksum": { | ||
"type": "keyword" | ||
}, | ||
"file_id": { | ||
"type": "keyword" | ||
}, | ||
"key": { | ||
"type": "keyword" | ||
}, | ||
"size": { | ||
"type": "keyword" | ||
}, | ||
"version_id": { | ||
"type": "keyword" | ||
} | ||
}, | ||
"type": "object" | ||
}, | ||
"identifiers": { | ||
"properties": { | ||
"material": { | ||
"type": "keyword" | ||
}, | ||
"scheme": { | ||
"type": "keyword" | ||
}, | ||
"value": { | ||
"type": "keyword", | ||
"fields": { | ||
"text": { | ||
"type": "text" | ||
} | ||
} | ||
} | ||
}, | ||
"type": "object" | ||
}, | ||
"internal_notes": { | ||
"type": "text" | ||
}, | ||
"open_access": { | ||
"type": "boolean" | ||
}, | ||
"pid": { | ||
"type": "keyword" | ||
}, | ||
"source": { | ||
"type": "keyword", | ||
"fields": { | ||
"text": { | ||
"type": "text" | ||
} | ||
} | ||
}, | ||
"urls": { | ||
"properties": { | ||
"description": { | ||
"type": "text" | ||
}, | ||
"value": { | ||
"type": "keyword" | ||
}, | ||
"login_required": { | ||
"type": "boolean" | ||
} | ||
}, | ||
"type": "object" | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
{ | ||
"mappings": { | ||
"date_detection": false, | ||
"numeric_detection": false, | ||
"properties": { | ||
"$schema": { | ||
"type": "keyword" | ||
}, | ||
"_created": { | ||
"type": "date" | ||
}, | ||
"_updated": { | ||
"type": "date" | ||
}, | ||
"bucket_id": { | ||
"type": "keyword" | ||
}, | ||
"created_by": { | ||
"properties": { | ||
"type": { | ||
"type": "keyword" | ||
}, | ||
"value": { | ||
"type": "keyword" | ||
} | ||
}, | ||
"type": "object" | ||
}, | ||
"description": { | ||
"type": "text" | ||
}, | ||
"document": { | ||
"properties": { | ||
"authors": { | ||
"type": "text" | ||
}, | ||
"cover_metadata": { | ||
"properties": {}, | ||
"type": "object" | ||
}, | ||
"edition": { | ||
"type": "text" | ||
}, | ||
"pid": { | ||
"type": "keyword" | ||
}, | ||
"publication_year": { | ||
"type": "keyword" | ||
}, | ||
"title": { | ||
"type": "text", | ||
"fields": { | ||
"keyword": { | ||
"type": "keyword" | ||
} | ||
} | ||
} | ||
}, | ||
"type": "object" | ||
}, | ||
"document_pid": { | ||
"type": "keyword" | ||
}, | ||
"eitem_type": { | ||
"type": "keyword" | ||
}, | ||
"files": { | ||
"properties": { | ||
"bucket": { | ||
"type": "keyword" | ||
}, | ||
"checksum": { | ||
"type": "keyword" | ||
}, | ||
"file_id": { | ||
"type": "keyword" | ||
}, | ||
"key": { | ||
"type": "keyword" | ||
}, | ||
"size": { | ||
"type": "keyword" | ||
}, | ||
"version_id": { | ||
"type": "keyword" | ||
} | ||
}, | ||
"type": "object" | ||
}, | ||
"identifiers": { | ||
"properties": { | ||
"material": { | ||
"type": "keyword" | ||
}, | ||
"scheme": { | ||
"type": "keyword" | ||
}, | ||
"value": { | ||
"type": "keyword", | ||
"fields": { | ||
"text": { | ||
"type": "text" | ||
} | ||
} | ||
} | ||
}, | ||
"type": "object" | ||
}, | ||
"internal_notes": { | ||
"type": "text" | ||
}, | ||
"open_access": { | ||
"type": "boolean" | ||
}, | ||
"pid": { | ||
"type": "keyword" | ||
}, | ||
"source": { | ||
"type": "keyword", | ||
"fields": { | ||
"text": { | ||
"type": "text" | ||
} | ||
} | ||
}, | ||
"urls": { | ||
"properties": { | ||
"description": { | ||
"type": "text" | ||
}, | ||
"value": { | ||
"type": "keyword" | ||
}, | ||
"login_required": { | ||
"type": "boolean" | ||
} | ||
}, | ||
"type": "object" | ||
} | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you check if
eitems
is immutable? When you use.filter
, does it change theeitems
object or simply return a new version with the filter applied?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it returns a new version of the object with the filter applied on it, it doesn't apply it in-place