-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathconfig.py
More file actions
30 lines (28 loc) · 1.02 KB
/
config.py
File metadata and controls
30 lines (28 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
class IndexSettings:
es_mappings = {
"properties": {
# common fields
"resource_type": {"type": "text"},
"creator": {"type": "keyword"},
"created": {"type": "date"},
"modified": {"type": "date"},
"user_ids": {"type": "keyword"},
"name": {"type": "text"},
"description": {"type": "text"},
"downloads": {"type": "long"},
# file-specific fields
"content_type": {"type": "keyword"},
"content_type_main": {"type": "keyword"},
"dataset_id": {"type": "text", "index": False},
"folder_id": {"type": "text", "index": False},
"bytes": {"type": "long"},
# metadata fields
"metadata": {
"type": "object",
"dynamic": True,
},
# metadata fields cast to plain string to enable search
"metadata_stringify": {"type": "text"},
}
}
indexSettings = IndexSettings()