@@ -66,8 +66,7 @@ class ElasticSearchBot(Bot):
66
66
67
67
EXACT_FIELD = {
68
68
'exact' : {
69
- 'type' : 'string' ,
70
- 'index' : 'not_analyzed' ,
69
+ 'type' : 'keyword' ,
71
70
# From Elasticsearch documentation:
72
71
# The value for ignore_above is the character count, but Lucene counts bytes.
73
72
# If you use UTF-8 text with many non-ASCII characters, you may want to set the limit to 32766 / 3 = 10922 since UTF-8 characters may occupy at most 3 bytes
@@ -79,67 +78,67 @@ class ElasticSearchBot(Bot):
79
78
'creativeworks' : {
80
79
'dynamic' : False ,
81
80
'properties' : {
82
- 'affiliations' : {'type' : 'string ' , 'fields' : EXACT_FIELD },
83
- 'contributors' : {'type' : 'string ' , 'fields' : EXACT_FIELD },
81
+ 'affiliations' : {'type' : 'text ' , 'fields' : EXACT_FIELD },
82
+ 'contributors' : {'type' : 'text ' , 'fields' : EXACT_FIELD },
84
83
'date' : {'type' : 'date' , 'format' : 'strict_date_optional_time' , 'include_in_all' : False },
85
84
'date_created' : {'type' : 'date' , 'format' : 'strict_date_optional_time' , 'include_in_all' : False },
86
85
'date_modified' : {'type' : 'date' , 'format' : 'strict_date_optional_time' , 'include_in_all' : False },
87
86
'date_published' : {'type' : 'date' , 'format' : 'strict_date_optional_time' , 'include_in_all' : False },
88
87
'date_updated' : {'type' : 'date' , 'format' : 'strict_date_optional_time' , 'include_in_all' : False },
89
- 'description' : {'type' : 'string ' },
90
- 'funders' : {'type' : 'string ' , 'fields' : EXACT_FIELD },
91
- 'hosts' : {'type' : 'string ' , 'fields' : EXACT_FIELD },
92
- 'id' : {'type' : 'string' , 'index' : 'not_analyzed ' , 'include_in_all' : False },
93
- 'identifiers' : {'type' : 'string ' , 'fields' : EXACT_FIELD },
94
- 'justification' : {'type' : 'string ' , 'include_in_all' : False },
95
- 'language' : {'type' : 'string' , 'index' : 'not_analyzed ' , 'include_in_all' : False },
96
- 'publishers' : {'type' : 'string ' , 'fields' : EXACT_FIELD },
97
- 'registration_type' : {'type' : 'string' , 'index' : 'not_analyzed ' , 'include_in_all' : False },
88
+ 'description' : {'type' : 'text ' },
89
+ 'funders' : {'type' : 'text ' , 'fields' : EXACT_FIELD },
90
+ 'hosts' : {'type' : 'text ' , 'fields' : EXACT_FIELD },
91
+ 'id' : {'type' : 'keyword ' , 'include_in_all' : False },
92
+ 'identifiers' : {'type' : 'text ' , 'fields' : EXACT_FIELD },
93
+ 'justification' : {'type' : 'text ' , 'include_in_all' : False },
94
+ 'language' : {'type' : 'keyword ' , 'include_in_all' : False },
95
+ 'publishers' : {'type' : 'text ' , 'fields' : EXACT_FIELD },
96
+ 'registration_type' : {'type' : 'keyword ' , 'include_in_all' : False },
98
97
'retracted' : {'type' : 'boolean' , 'include_in_all' : False },
99
- 'sources' : {'type' : 'string' , 'index' : 'not_analyzed ' , 'include_in_all' : False },
100
- 'subjects' : {'type' : 'string' , 'index' : 'not_analyzed ' , 'include_in_all' : False },
101
- 'tags' : {'type' : 'string ' , 'fields' : EXACT_FIELD },
102
- 'title' : {'type' : 'string ' , 'fields' : EXACT_FIELD },
103
- 'type' : {'type' : 'string' , 'index' : 'not_analyzed ' , 'include_in_all' : False },
104
- 'types' : {'type' : 'string' , 'index' : 'not_analyzed ' , 'include_in_all' : False },
98
+ 'sources' : {'type' : 'keyword ' , 'include_in_all' : False },
99
+ 'subjects' : {'type' : 'keyword ' , 'include_in_all' : False },
100
+ 'tags' : {'type' : 'text ' , 'fields' : EXACT_FIELD },
101
+ 'title' : {'type' : 'text ' , 'fields' : EXACT_FIELD },
102
+ 'type' : {'type' : 'keyword ' , 'include_in_all' : False },
103
+ 'types' : {'type' : 'keyword ' , 'include_in_all' : False },
105
104
'withdrawn' : {'type' : 'boolean' , 'include_in_all' : False },
106
105
'lists' : {'type' : 'object' , 'dynamic' : True , 'include_in_all' : False },
107
106
},
108
107
'dynamic_templates' : [
109
- {'exact_field_on_lists_strings' : {'path_match' : 'lists.*' , 'match_mapping_type' : 'string' , 'mapping' : {'type' : 'string ' , 'fields' : EXACT_FIELD }}},
108
+ {'exact_field_on_lists_strings' : {'path_match' : 'lists.*' , 'match_mapping_type' : 'string' , 'mapping' : {'type' : 'text ' , 'fields' : EXACT_FIELD }}},
110
109
]
111
110
},
112
111
'agents' : {
113
112
'dynamic' : False ,
114
113
'properties' : {
115
- 'id' : {'type' : 'string' , 'index' : 'not_analyzed ' , 'include_in_all' : False },
116
- 'identifiers' : {'type' : 'string ' , 'fields' : EXACT_FIELD },
117
- 'name' : {'type' : 'string ' , 'fields' : {** AUTOCOMPLETE_FIELD , ** EXACT_FIELD }},
118
- 'family_name' : {'type' : 'string ' , 'include_in_all' : False },
119
- 'given_name' : {'type' : 'string ' , 'include_in_all' : False },
120
- 'additional_name' : {'type' : 'string ' , 'include_in_all' : False },
121
- 'suffix' : {'type' : 'string ' , 'include_in_all' : False },
122
- 'location' : {'type' : 'string ' , 'include_in_all' : False },
123
- 'sources' : {'type' : 'string' , 'index' : 'not_analyzed ' , 'include_in_all' : False },
124
- 'type' : {'type' : 'string' , 'index' : 'not_analyzed ' , 'include_in_all' : False },
125
- 'types' : {'type' : 'string' , 'index' : 'not_analyzed ' , 'include_in_all' : False },
114
+ 'id' : {'type' : 'keyword ' , 'include_in_all' : False },
115
+ 'identifiers' : {'type' : 'text ' , 'fields' : EXACT_FIELD },
116
+ 'name' : {'type' : 'text ' , 'fields' : {** AUTOCOMPLETE_FIELD , ** EXACT_FIELD }},
117
+ 'family_name' : {'type' : 'text ' , 'include_in_all' : False },
118
+ 'given_name' : {'type' : 'text ' , 'include_in_all' : False },
119
+ 'additional_name' : {'type' : 'text ' , 'include_in_all' : False },
120
+ 'suffix' : {'type' : 'text ' , 'include_in_all' : False },
121
+ 'location' : {'type' : 'text ' , 'include_in_all' : False },
122
+ 'sources' : {'type' : 'keyword ' , 'include_in_all' : False },
123
+ 'type' : {'type' : 'keyword ' , 'include_in_all' : False },
124
+ 'types' : {'type' : 'keyword ' , 'include_in_all' : False },
126
125
}
127
126
},
128
127
'sources' : {
129
128
'dynamic' : False ,
130
129
'properties' : {
131
- 'id' : {'type' : 'string' , 'index' : 'not_analyzed ' , 'include_in_all' : False },
132
- 'name' : {'type' : 'string ' , 'fields' : {** AUTOCOMPLETE_FIELD , ** EXACT_FIELD }},
133
- 'short_name' : {'type' : 'string' , 'index' : 'not_analyzed ' , 'include_in_all' : False },
134
- 'type' : {'type' : 'string' , 'index' : 'not_analyzed ' , 'include_in_all' : False },
130
+ 'id' : {'type' : 'keyword ' , 'include_in_all' : False },
131
+ 'name' : {'type' : 'text ' , 'fields' : {** AUTOCOMPLETE_FIELD , ** EXACT_FIELD }},
132
+ 'short_name' : {'type' : 'keyword ' , 'include_in_all' : False },
133
+ 'type' : {'type' : 'keyword ' , 'include_in_all' : False },
135
134
}
136
135
},
137
136
'tags' : {
138
137
'dynamic' : False ,
139
138
'properties' : {
140
- 'id' : {'type' : 'string' , 'index' : 'not_analyzed ' , 'include_in_all' : False },
141
- 'name' : {'type' : 'string ' , 'fields' : {** AUTOCOMPLETE_FIELD , ** EXACT_FIELD }},
142
- 'type' : {'type' : 'string' , 'index' : 'not_analyzed ' , 'include_in_all' : False },
139
+ 'id' : {'type' : 'keyword ' , 'include_in_all' : False },
140
+ 'name' : {'type' : 'text ' , 'fields' : {** AUTOCOMPLETE_FIELD , ** EXACT_FIELD }},
141
+ 'type' : {'type' : 'keyword ' , 'include_in_all' : False },
143
142
}
144
143
},
145
144
}
0 commit comments