pelias-schema 6.8.0 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/configValidation.js +0 -1
- package/integration/address_matching.js +0 -16
- package/integration/admin_abbreviations.js +0 -15
- package/integration/admin_matching.js +0 -4
- package/integration/analyzer_peliasPhrase.js +0 -5
- package/integration/autocomplete_abbreviated_street_names.js +0 -5
- package/integration/autocomplete_directional_synonym_expansion.js +0 -10
- package/integration/autocomplete_street_synonym_expansion.js +0 -10
- package/integration/bounding_box.js +0 -2
- package/integration/dynamic_templates.js +0 -10
- package/integration/multi_token_synonyms.js +0 -1
- package/integration/run.js +1 -3
- package/integration/source_layer_sourceid_filtering.js +4 -11
- package/mappings/partial/admin.json +1 -2
- package/mappings/partial/countryAbbreviation.json +1 -2
- package/package.json +2 -3
- package/scripts/check_plugins.js +1 -10
- package/scripts/create_index.js +0 -1
- package/scripts/list_analyzers.js +1 -2
- package/scripts/output_mapping.js +1 -18
- package/settings.js +1 -1
- package/test/configValidation.js +1 -37
- package/test/fixtures/expected.json +29 -57
- package/test/settings.js +1 -1
- package/scripts/reset_type.js +0 -26
package/README.md
CHANGED
@@ -64,7 +64,7 @@ node scripts/update_settings.js # update index settings
|
|
64
64
|
|
65
65
|
#### output schema file
|
66
66
|
|
67
|
-
Use this script to pretty-print the
|
67
|
+
Use this script to pretty-print the schema's mappings to stdout.
|
68
68
|
|
69
69
|
```bash
|
70
70
|
node scripts/output_mapping.js
|
package/configValidation.js
CHANGED
@@ -16,7 +16,6 @@ module.exports.tests.functional = function(test, common){
|
|
16
16
|
suite.action( function( done ){
|
17
17
|
suite.client.index({
|
18
18
|
index: suite.props.index,
|
19
|
-
type: config.schema.typeName,
|
20
19
|
id: '1', body: { address_parts: {
|
21
20
|
name: 'Mapzen HQ',
|
22
21
|
number: 30,
|
@@ -29,7 +28,6 @@ module.exports.tests.functional = function(test, common){
|
|
29
28
|
suite.action( function( done ){
|
30
29
|
suite.client.index({
|
31
30
|
index: suite.props.index,
|
32
|
-
type: config.schema.typeName,
|
33
31
|
id: '2', body: { address_parts: {
|
34
32
|
name: 'Fake Venue',
|
35
33
|
number: 300,
|
@@ -42,7 +40,6 @@ module.exports.tests.functional = function(test, common){
|
|
42
40
|
suite.action( function( done ){
|
43
41
|
suite.client.index({
|
44
42
|
index: suite.props.index,
|
45
|
-
type: config.schema.typeName,
|
46
43
|
id: '3', body: { address_parts: {
|
47
44
|
name: 'Mock British Address',
|
48
45
|
number: 3000,
|
@@ -55,7 +52,6 @@ module.exports.tests.functional = function(test, common){
|
|
55
52
|
suite.action( function( done ){
|
56
53
|
suite.client.index({
|
57
54
|
index: suite.props.index,
|
58
|
-
type: config.schema.typeName,
|
59
55
|
id: '4', body: { address_parts: {
|
60
56
|
name: 'Mystery Location',
|
61
57
|
number: 300,
|
@@ -69,7 +65,6 @@ module.exports.tests.functional = function(test, common){
|
|
69
65
|
suite.assert( function( done ){
|
70
66
|
suite.client.search({
|
71
67
|
index: suite.props.index,
|
72
|
-
type: config.schema.typeName,
|
73
68
|
body: { query: { bool: { must: [
|
74
69
|
{ match: { 'address_parts.number': 30 } }
|
75
70
|
]}}}
|
@@ -84,7 +79,6 @@ module.exports.tests.functional = function(test, common){
|
|
84
79
|
suite.assert( function( done ){
|
85
80
|
suite.client.search({
|
86
81
|
index: suite.props.index,
|
87
|
-
type: config.schema.typeName,
|
88
82
|
body: { query: { bool: { must: [
|
89
83
|
{ match_phrase: { 'address_parts.street': 'west 26th street' } }
|
90
84
|
]}}}
|
@@ -99,7 +93,6 @@ module.exports.tests.functional = function(test, common){
|
|
99
93
|
suite.assert( function( done ){
|
100
94
|
suite.client.search({
|
101
95
|
index: suite.props.index,
|
102
|
-
type: config.schema.typeName,
|
103
96
|
body: { query: { bool: { must: [
|
104
97
|
{ match_phrase: { 'address_parts.street': 'W 26th ST' } }
|
105
98
|
]}}}
|
@@ -114,7 +107,6 @@ module.exports.tests.functional = function(test, common){
|
|
114
107
|
suite.assert( function( done ){
|
115
108
|
suite.client.search({
|
116
109
|
index: suite.props.index,
|
117
|
-
type: config.schema.typeName,
|
118
110
|
body: { query: { bool: { must: [
|
119
111
|
{ match: { 'address_parts.zip': '10010' } }
|
120
112
|
]}}}
|
@@ -129,7 +121,6 @@ module.exports.tests.functional = function(test, common){
|
|
129
121
|
suite.assert( function( done ){
|
130
122
|
suite.client.search({
|
131
123
|
index: suite.props.index,
|
132
|
-
type: config.schema.typeName,
|
133
124
|
body: { query: { bool: { must: [
|
134
125
|
{ match: { 'address_parts.zip': 'e24dn' } }
|
135
126
|
]}}}
|
@@ -144,7 +135,6 @@ module.exports.tests.functional = function(test, common){
|
|
144
135
|
suite.assert( function( done ){
|
145
136
|
suite.client.search({
|
146
137
|
index: suite.props.index,
|
147
|
-
type: config.schema.typeName,
|
148
138
|
body: { query: { bool: { must: [
|
149
139
|
{ match: { 'address_parts.zip': '100-10' } }
|
150
140
|
]}}}
|
@@ -159,7 +149,6 @@ module.exports.tests.functional = function(test, common){
|
|
159
149
|
suite.assert( function( done ){
|
160
150
|
suite.client.search({
|
161
151
|
index: suite.props.index,
|
162
|
-
type: config.schema.typeName,
|
163
152
|
body: { query: { bool: { must: [
|
164
153
|
{ match: { 'address_parts.zip': '10 0 10' } }
|
165
154
|
]}}}
|
@@ -174,7 +163,6 @@ module.exports.tests.functional = function(test, common){
|
|
174
163
|
suite.assert( function( done ){
|
175
164
|
suite.client.search({
|
176
165
|
index: suite.props.index,
|
177
|
-
type: config.schema.typeName,
|
178
166
|
body: { query: { bool: { must: [
|
179
167
|
{ match: { 'address_parts.zip': 'E2-4DN' } }
|
180
168
|
]}}}
|
@@ -189,7 +177,6 @@ module.exports.tests.functional = function(test, common){
|
|
189
177
|
suite.assert( function( done ){
|
190
178
|
suite.client.search({
|
191
179
|
index: suite.props.index,
|
192
|
-
type: config.schema.typeName,
|
193
180
|
body: { query: { bool: { must: [
|
194
181
|
{ match: { 'address_parts.zip': 'E2 4DN' } }
|
195
182
|
]}}}
|
@@ -224,7 +211,6 @@ module.exports.tests.venue_vs_address = function(test, common){
|
|
224
211
|
suite.action( function( done ){
|
225
212
|
suite.client.index({
|
226
213
|
index: suite.props.index,
|
227
|
-
type: config.schema.typeName,
|
228
214
|
id: '1', body: {
|
229
215
|
name: { default: 'Union Square' },
|
230
216
|
phrase: { default: 'Union Square' }
|
@@ -239,7 +225,6 @@ module.exports.tests.venue_vs_address = function(test, common){
|
|
239
225
|
let id = i + 100; // id offset
|
240
226
|
suite.client.index({
|
241
227
|
index: suite.props.index,
|
242
|
-
type: config.schema.typeName,
|
243
228
|
id: String(id),
|
244
229
|
body: {
|
245
230
|
name: { default: `${id} Union Square` },
|
@@ -263,7 +248,6 @@ module.exports.tests.venue_vs_address = function(test, common){
|
|
263
248
|
suite.assert( function( done ){
|
264
249
|
suite.client.search({
|
265
250
|
index: suite.props.index,
|
266
|
-
type: config.schema.typeName,
|
267
251
|
searchType: 'dfs_query_then_fetch',
|
268
252
|
size: TOTAL_ADDRESS_DOCS+1,
|
269
253
|
body: {
|
@@ -19,7 +19,6 @@ module.exports.tests.synonyms = function (test, common) {
|
|
19
19
|
suite.action(done => {
|
20
20
|
suite.client.index({
|
21
21
|
index: suite.props.index,
|
22
|
-
type: config.schema.typeName,
|
23
22
|
id: '1',
|
24
23
|
body: {
|
25
24
|
parent: {
|
@@ -33,7 +32,6 @@ module.exports.tests.synonyms = function (test, common) {
|
|
33
32
|
suite.action(done => {
|
34
33
|
suite.client.index({
|
35
34
|
index: suite.props.index,
|
36
|
-
type: config.schema.typeName,
|
37
35
|
id: '2',
|
38
36
|
body: {
|
39
37
|
parent: {
|
@@ -47,7 +45,6 @@ module.exports.tests.synonyms = function (test, common) {
|
|
47
45
|
suite.assert(done => {
|
48
46
|
suite.client.search({
|
49
47
|
index: suite.props.index,
|
50
|
-
type: config.schema.typeName,
|
51
48
|
searchType: 'dfs_query_then_fetch',
|
52
49
|
body: {
|
53
50
|
query: {
|
@@ -70,7 +67,6 @@ module.exports.tests.synonyms = function (test, common) {
|
|
70
67
|
suite.assert(done => {
|
71
68
|
suite.client.search({
|
72
69
|
index: suite.props.index,
|
73
|
-
type: config.schema.typeName,
|
74
70
|
searchType: 'dfs_query_then_fetch',
|
75
71
|
body: {
|
76
72
|
query: {
|
@@ -93,7 +89,6 @@ module.exports.tests.synonyms = function (test, common) {
|
|
93
89
|
suite.assert(done => {
|
94
90
|
suite.client.search({
|
95
91
|
index: suite.props.index,
|
96
|
-
type: config.schema.typeName,
|
97
92
|
searchType: 'dfs_query_then_fetch',
|
98
93
|
body: {
|
99
94
|
query: {
|
@@ -116,7 +111,6 @@ module.exports.tests.synonyms = function (test, common) {
|
|
116
111
|
suite.assert(done => {
|
117
112
|
suite.client.search({
|
118
113
|
index: suite.props.index,
|
119
|
-
type: config.schema.typeName,
|
120
114
|
searchType: 'dfs_query_then_fetch',
|
121
115
|
body: {
|
122
116
|
query: {
|
@@ -147,7 +141,6 @@ module.exports.tests.synonyms = function (test, common) {
|
|
147
141
|
suite.action(done => {
|
148
142
|
suite.client.index({
|
149
143
|
index: suite.props.index,
|
150
|
-
type: config.schema.typeName,
|
151
144
|
id: '1',
|
152
145
|
body: {
|
153
146
|
parent: {
|
@@ -161,7 +154,6 @@ module.exports.tests.synonyms = function (test, common) {
|
|
161
154
|
suite.action(done => {
|
162
155
|
suite.client.index({
|
163
156
|
index: suite.props.index,
|
164
|
-
type: config.schema.typeName,
|
165
157
|
id: '2',
|
166
158
|
body: {
|
167
159
|
parent: {
|
@@ -175,7 +167,6 @@ module.exports.tests.synonyms = function (test, common) {
|
|
175
167
|
suite.assert(done => {
|
176
168
|
suite.client.search({
|
177
169
|
index: suite.props.index,
|
178
|
-
type: config.schema.typeName,
|
179
170
|
searchType: 'dfs_query_then_fetch',
|
180
171
|
body: {
|
181
172
|
query: {
|
@@ -198,7 +189,6 @@ module.exports.tests.synonyms = function (test, common) {
|
|
198
189
|
suite.assert(done => {
|
199
190
|
suite.client.search({
|
200
191
|
index: suite.props.index,
|
201
|
-
type: config.schema.typeName,
|
202
192
|
searchType: 'dfs_query_then_fetch',
|
203
193
|
body: {
|
204
194
|
query: {
|
@@ -221,7 +211,6 @@ module.exports.tests.synonyms = function (test, common) {
|
|
221
211
|
suite.assert(done => {
|
222
212
|
suite.client.search({
|
223
213
|
index: suite.props.index,
|
224
|
-
type: config.schema.typeName,
|
225
214
|
searchType: 'dfs_query_then_fetch',
|
226
215
|
body: {
|
227
216
|
query: {
|
@@ -244,7 +233,6 @@ module.exports.tests.synonyms = function (test, common) {
|
|
244
233
|
suite.assert(done => {
|
245
234
|
suite.client.search({
|
246
235
|
index: suite.props.index,
|
247
|
-
type: config.schema.typeName,
|
248
236
|
searchType: 'dfs_query_then_fetch',
|
249
237
|
body: {
|
250
238
|
query: {
|
@@ -275,7 +263,6 @@ module.exports.tests.synonyms = function (test, common) {
|
|
275
263
|
suite.action(done => {
|
276
264
|
suite.client.index({
|
277
265
|
index: suite.props.index,
|
278
|
-
type: config.schema.typeName,
|
279
266
|
id: '1',
|
280
267
|
body: {
|
281
268
|
parent: {
|
@@ -289,7 +276,6 @@ module.exports.tests.synonyms = function (test, common) {
|
|
289
276
|
suite.action(done => {
|
290
277
|
suite.client.index({
|
291
278
|
index: suite.props.index,
|
292
|
-
type: config.schema.typeName,
|
293
279
|
id: '2',
|
294
280
|
body: {
|
295
281
|
parent: {
|
@@ -303,7 +289,6 @@ module.exports.tests.synonyms = function (test, common) {
|
|
303
289
|
suite.assert(done => {
|
304
290
|
suite.client.search({
|
305
291
|
index: suite.props.index,
|
306
|
-
type: config.schema.typeName,
|
307
292
|
searchType: 'dfs_query_then_fetch',
|
308
293
|
body: {
|
309
294
|
query: {
|
@@ -16,7 +16,6 @@ module.exports.tests.functional = function(test, common){
|
|
16
16
|
suite.action( function( done ){
|
17
17
|
suite.client.index({
|
18
18
|
index: suite.props.index,
|
19
|
-
type: config.schema.typeName,
|
20
19
|
id: '1', body: {
|
21
20
|
parent: {
|
22
21
|
country: 'Test Country',
|
@@ -46,7 +45,6 @@ module.exports.tests.functional = function(test, common){
|
|
46
45
|
suite.assert( function( done ){
|
47
46
|
suite.client.search({
|
48
47
|
index: suite.props.index,
|
49
|
-
type: config.schema.typeName,
|
50
48
|
body: { query: { match: { 'parent.country': 'Test Country' } } }
|
51
49
|
}, function( err, res ){
|
52
50
|
t.equal( err, undefined );
|
@@ -59,7 +57,6 @@ module.exports.tests.functional = function(test, common){
|
|
59
57
|
suite.assert( function( done ){
|
60
58
|
suite.client.search({
|
61
59
|
index: suite.props.index,
|
62
|
-
type: config.schema.typeName,
|
63
60
|
body: { query: { match: { 'parent.country_a': 'TestCountry' } } }
|
64
61
|
}, function( err, res ){
|
65
62
|
t.equal( err, undefined );
|
@@ -72,7 +69,6 @@ module.exports.tests.functional = function(test, common){
|
|
72
69
|
suite.assert( function( done ){
|
73
70
|
suite.client.search({
|
74
71
|
index: suite.props.index,
|
75
|
-
type: config.schema.typeName,
|
76
72
|
body: { query: { match: { 'parent.country_id': '100' } } }
|
77
73
|
}, function( err, res ){
|
78
74
|
t.equal( err, undefined );
|
@@ -161,7 +161,6 @@ module.exports.tests.slop_query = function(test, common){
|
|
161
161
|
suite.action( function( done ){
|
162
162
|
suite.client.index({
|
163
163
|
index: suite.props.index,
|
164
|
-
type: config.schema.typeName,
|
165
164
|
id: '1',
|
166
165
|
body: { name: { default: 'Lake Cayuga' }, phrase: { default: 'Lake Cayuga' } }
|
167
166
|
}, done );
|
@@ -171,7 +170,6 @@ module.exports.tests.slop_query = function(test, common){
|
|
171
170
|
suite.action( function( done ){
|
172
171
|
suite.client.index({
|
173
172
|
index: suite.props.index,
|
174
|
-
type: config.schema.typeName,
|
175
173
|
id: '2',
|
176
174
|
body: { name: { default: 'Cayuga Lake' }, phrase: { default: 'Cayuga Lake' } }
|
177
175
|
}, done );
|
@@ -181,7 +179,6 @@ module.exports.tests.slop_query = function(test, common){
|
|
181
179
|
suite.action( function( done ){
|
182
180
|
suite.client.index({
|
183
181
|
index: suite.props.index,
|
184
|
-
type: config.schema.typeName,
|
185
182
|
id: '3',
|
186
183
|
body: { name: { default: '7991 Lake Cayuga Dr' }, phrase: { default: '7991 Lake Cayuga Dr' } }
|
187
184
|
}, done );
|
@@ -256,7 +253,6 @@ module.exports.tests.slop = function(test, common){
|
|
256
253
|
suite.action( function( done ){
|
257
254
|
suite.client.index({
|
258
255
|
index: suite.props.index,
|
259
|
-
type: config.schema.typeName,
|
260
256
|
id: '1',
|
261
257
|
body: { name: { default: '52 Görlitzer Straße' } }
|
262
258
|
}, done);
|
@@ -269,7 +265,6 @@ module.exports.tests.slop = function(test, common){
|
|
269
265
|
suite.assert( function( done ){
|
270
266
|
suite.client.search({
|
271
267
|
index: suite.props.index,
|
272
|
-
type: config.schema.typeName,
|
273
268
|
searchType: 'dfs_query_then_fetch',
|
274
269
|
body: { query: { match_phrase: {
|
275
270
|
'name.default': {
|
@@ -21,7 +21,6 @@ module.exports.tests.index_expanded_form_search_contracted = function(test, comm
|
|
21
21
|
suite.action( function( done ){
|
22
22
|
suite.client.index({
|
23
23
|
index: suite.props.index,
|
24
|
-
type: config.schema.typeName,
|
25
24
|
id: '1',
|
26
25
|
body: { name: { default: 'Grolmanstraße' } }
|
27
26
|
}, done);
|
@@ -31,7 +30,6 @@ module.exports.tests.index_expanded_form_search_contracted = function(test, comm
|
|
31
30
|
suite.assert( function( done ){
|
32
31
|
suite.client.search({
|
33
32
|
index: suite.props.index,
|
34
|
-
type: config.schema.typeName,
|
35
33
|
body: { query: { match: {
|
36
34
|
'name.default': {
|
37
35
|
'analyzer': 'peliasQuery',
|
@@ -62,7 +60,6 @@ module.exports.tests.index_expanded_form_search_contracted = function(test, comm
|
|
62
60
|
// suite.action( function( done ){
|
63
61
|
// suite.client.index({
|
64
62
|
// index: suite.props.index,
|
65
|
-
// type: config.schema.typeName,
|
66
63
|
// id: '1',
|
67
64
|
// body: { name: { default: 'Grolmanstr.' } }
|
68
65
|
// }, done);
|
@@ -75,7 +72,6 @@ module.exports.tests.index_expanded_form_search_contracted = function(test, comm
|
|
75
72
|
// suite.assert( function( done ){
|
76
73
|
// suite.client.search({
|
77
74
|
// index: suite.props.index,
|
78
|
-
// type: config.schema.typeName,
|
79
75
|
// body: { query: { match: {
|
80
76
|
// 'name.default': {
|
81
77
|
// 'analyzer': 'peliasQueryPartialToken',
|
@@ -96,7 +92,6 @@ module.exports.tests.index_expanded_form_search_contracted = function(test, comm
|
|
96
92
|
// suite.assert( function( done ){
|
97
93
|
// suite.client.search({
|
98
94
|
// index: suite.props.index,
|
99
|
-
// type: config.schema.typeName,
|
100
95
|
// body: { query: { match: {
|
101
96
|
// 'name.default': {
|
102
97
|
// 'analyzer': 'peliasQuery',
|
@@ -21,7 +21,6 @@ module.exports.tests.index_and_retrieve_expanded_form = function(test, common){
|
|
21
21
|
suite.action( function( done ){
|
22
22
|
suite.client.index({
|
23
23
|
index: suite.props.index,
|
24
|
-
type: config.schema.typeName,
|
25
24
|
id: '1',
|
26
25
|
body: { name: { default: 'north' } }
|
27
26
|
}, done);
|
@@ -31,7 +30,6 @@ module.exports.tests.index_and_retrieve_expanded_form = function(test, common){
|
|
31
30
|
suite.assert( function( done ){
|
32
31
|
suite.client.search({
|
33
32
|
index: suite.props.index,
|
34
|
-
type: config.schema.typeName,
|
35
33
|
body: { query: { match: {
|
36
34
|
'name.default': {
|
37
35
|
'analyzer': 'peliasQuery',
|
@@ -49,7 +47,6 @@ module.exports.tests.index_and_retrieve_expanded_form = function(test, common){
|
|
49
47
|
suite.assert( function( done ){
|
50
48
|
suite.client.search({
|
51
49
|
index: suite.props.index,
|
52
|
-
type: config.schema.typeName,
|
53
50
|
body: { query: { match: {
|
54
51
|
'name.default': {
|
55
52
|
'analyzer': 'peliasQuery',
|
@@ -78,7 +75,6 @@ module.exports.tests.index_and_retrieve_contracted_form = function(test, common)
|
|
78
75
|
suite.action( function( done ){
|
79
76
|
suite.client.index({
|
80
77
|
index: suite.props.index,
|
81
|
-
type: config.schema.typeName,
|
82
78
|
id: '1',
|
83
79
|
body: { name: { default: 'n' } }
|
84
80
|
}, done);
|
@@ -88,7 +84,6 @@ module.exports.tests.index_and_retrieve_contracted_form = function(test, common)
|
|
88
84
|
suite.assert( function( done ){
|
89
85
|
suite.client.search({
|
90
86
|
index: suite.props.index,
|
91
|
-
type: config.schema.typeName,
|
92
87
|
body: { query: { match: {
|
93
88
|
'name.default': {
|
94
89
|
'analyzer': 'peliasQuery',
|
@@ -117,7 +112,6 @@ module.exports.tests.index_and_retrieve_mixed_form_1 = function(test, common){
|
|
117
112
|
suite.action( function( done ){
|
118
113
|
suite.client.index({
|
119
114
|
index: suite.props.index,
|
120
|
-
type: config.schema.typeName,
|
121
115
|
id: '1',
|
122
116
|
body: { name: { default: 'n' } }
|
123
117
|
}, done);
|
@@ -127,7 +121,6 @@ module.exports.tests.index_and_retrieve_mixed_form_1 = function(test, common){
|
|
127
121
|
suite.assert( function( done ){
|
128
122
|
suite.client.search({
|
129
123
|
index: suite.props.index,
|
130
|
-
type: config.schema.typeName,
|
131
124
|
body: { query: { match: {
|
132
125
|
'name.default': {
|
133
126
|
'analyzer': 'peliasQuery',
|
@@ -145,7 +138,6 @@ module.exports.tests.index_and_retrieve_mixed_form_1 = function(test, common){
|
|
145
138
|
suite.assert( function( done ){
|
146
139
|
suite.client.search({
|
147
140
|
index: suite.props.index,
|
148
|
-
type: config.schema.typeName,
|
149
141
|
body: { query: { match: {
|
150
142
|
'name.default': {
|
151
143
|
'analyzer': 'peliasQuery',
|
@@ -174,7 +166,6 @@ module.exports.tests.index_and_retrieve_mixed_form_2 = function(test, common){
|
|
174
166
|
suite.action( function( done ){
|
175
167
|
suite.client.index({
|
176
168
|
index: suite.props.index,
|
177
|
-
type: config.schema.typeName,
|
178
169
|
id: '1',
|
179
170
|
body: { name: { default: 'north' } }
|
180
171
|
}, done);
|
@@ -184,7 +175,6 @@ module.exports.tests.index_and_retrieve_mixed_form_2 = function(test, common){
|
|
184
175
|
suite.assert( function( done ){
|
185
176
|
suite.client.search({
|
186
177
|
index: suite.props.index,
|
187
|
-
type: config.schema.typeName,
|
188
178
|
body: { query: { match: {
|
189
179
|
'name.default': {
|
190
180
|
'analyzer': 'peliasQuery',
|
@@ -22,7 +22,6 @@ module.exports.tests.index_and_retrieve_expanded_form = function(test, common){
|
|
22
22
|
suite.action( function( done ){
|
23
23
|
suite.client.index({
|
24
24
|
index: suite.props.index,
|
25
|
-
type: config.schema.typeName,
|
26
25
|
id: '1',
|
27
26
|
body: { name: { default: 'center' } }
|
28
27
|
}, done);
|
@@ -32,7 +31,6 @@ module.exports.tests.index_and_retrieve_expanded_form = function(test, common){
|
|
32
31
|
suite.assert( function( done ){
|
33
32
|
suite.client.search({
|
34
33
|
index: suite.props.index,
|
35
|
-
type: config.schema.typeName,
|
36
34
|
body: { query: { match: {
|
37
35
|
'name.default': {
|
38
36
|
'analyzer': 'peliasQuery',
|
@@ -50,7 +48,6 @@ module.exports.tests.index_and_retrieve_expanded_form = function(test, common){
|
|
50
48
|
suite.assert( function( done ){
|
51
49
|
suite.client.search({
|
52
50
|
index: suite.props.index,
|
53
|
-
type: config.schema.typeName,
|
54
51
|
body: { query: { match: {
|
55
52
|
'name.default': {
|
56
53
|
'analyzer': 'peliasQuery',
|
@@ -79,7 +76,6 @@ module.exports.tests.index_and_retrieve_contracted_form = function(test, common)
|
|
79
76
|
suite.action( function( done ){
|
80
77
|
suite.client.index({
|
81
78
|
index: suite.props.index,
|
82
|
-
type: config.schema.typeName,
|
83
79
|
id: '1',
|
84
80
|
body: { name: { default: 'ctr' } }
|
85
81
|
}, done);
|
@@ -89,7 +85,6 @@ module.exports.tests.index_and_retrieve_contracted_form = function(test, common)
|
|
89
85
|
suite.assert( function( done ){
|
90
86
|
suite.client.search({
|
91
87
|
index: suite.props.index,
|
92
|
-
type: config.schema.typeName,
|
93
88
|
body: { query: { match: {
|
94
89
|
'name.default': {
|
95
90
|
'analyzer': 'peliasQuery',
|
@@ -118,7 +113,6 @@ module.exports.tests.index_and_retrieve_mixed_form_1 = function(test, common){
|
|
118
113
|
suite.action( function( done ){
|
119
114
|
suite.client.index({
|
120
115
|
index: suite.props.index,
|
121
|
-
type: config.schema.typeName,
|
122
116
|
id: '1',
|
123
117
|
body: { name: { default: 'ctr' } }
|
124
118
|
}, done);
|
@@ -128,7 +122,6 @@ module.exports.tests.index_and_retrieve_mixed_form_1 = function(test, common){
|
|
128
122
|
suite.assert( function( done ){
|
129
123
|
suite.client.search({
|
130
124
|
index: suite.props.index,
|
131
|
-
type: config.schema.typeName,
|
132
125
|
body: { query: { match: {
|
133
126
|
'name.default': {
|
134
127
|
'analyzer': 'peliasQuery',
|
@@ -146,7 +139,6 @@ module.exports.tests.index_and_retrieve_mixed_form_1 = function(test, common){
|
|
146
139
|
suite.assert( function( done ){
|
147
140
|
suite.client.search({
|
148
141
|
index: suite.props.index,
|
149
|
-
type: config.schema.typeName,
|
150
142
|
body: { query: { match: {
|
151
143
|
'name.default': {
|
152
144
|
'analyzer': 'peliasQuery',
|
@@ -175,7 +167,6 @@ module.exports.tests.index_and_retrieve_mixed_form_2 = function(test, common){
|
|
175
167
|
suite.action( function( done ){
|
176
168
|
suite.client.index({
|
177
169
|
index: suite.props.index,
|
178
|
-
type: config.schema.typeName,
|
179
170
|
id: '1',
|
180
171
|
body: { name: { default: 'center' } }
|
181
172
|
}, done);
|
@@ -185,7 +176,6 @@ module.exports.tests.index_and_retrieve_mixed_form_2 = function(test, common){
|
|
185
176
|
suite.assert( function( done ){
|
186
177
|
suite.client.search({
|
187
178
|
index: suite.props.index,
|
188
|
-
type: config.schema.typeName,
|
189
179
|
body: { query: { match: {
|
190
180
|
'name.default': {
|
191
181
|
'analyzer': 'peliasQuery',
|
@@ -15,7 +15,6 @@ module.exports.tests.index_and_retrieve = function(test, common){
|
|
15
15
|
suite.action( function( done ){
|
16
16
|
suite.client.index({
|
17
17
|
index: suite.props.index,
|
18
|
-
type: config.schema.typeName,
|
19
18
|
id: '1',
|
20
19
|
body: {
|
21
20
|
bounding_box: '{"min_lat":-47.75,"max_lat":-33.9,"min_lon":163.82,"max_lon":179.42}'
|
@@ -28,7 +27,6 @@ module.exports.tests.index_and_retrieve = function(test, common){
|
|
28
27
|
suite.client.get(
|
29
28
|
{
|
30
29
|
index: suite.props.index,
|
31
|
-
type: config.schema.typeName,
|
32
30
|
id: '1'
|
33
31
|
},
|
34
32
|
function (err, res) {
|
@@ -32,13 +32,11 @@ function nameAssertion( analyzer, common ){
|
|
32
32
|
return function(t){
|
33
33
|
|
34
34
|
var suite = new Suite( common.clientOpts, common.create );
|
35
|
-
const _type = config.schema.typeName;
|
36
35
|
|
37
36
|
// index a document from a normal document layer
|
38
37
|
suite.action( done => {
|
39
38
|
suite.client.index({
|
40
39
|
index: suite.props.index,
|
41
|
-
type: _type,
|
42
40
|
id: '1',
|
43
41
|
body: { name: { default: 'foo', alt: 'bar' } }
|
44
42
|
}, done );
|
@@ -50,7 +48,6 @@ function nameAssertion( analyzer, common ){
|
|
50
48
|
|
51
49
|
suite.client.indices.getMapping({
|
52
50
|
index: suite.props.index,
|
53
|
-
include_type_name: false
|
54
51
|
}, (err, res) => {
|
55
52
|
|
56
53
|
const properties = res[suite.props.index].mappings.properties;
|
@@ -71,13 +68,11 @@ function phraseAssertion( analyzer, common ){
|
|
71
68
|
return function(t){
|
72
69
|
|
73
70
|
const suite = new Suite( common.clientOpts, common.create );
|
74
|
-
const _type = config.schema.typeName;
|
75
71
|
|
76
72
|
// index a document from a normal document layer
|
77
73
|
suite.action( done => {
|
78
74
|
suite.client.index({
|
79
75
|
index: suite.props.index,
|
80
|
-
type: _type,
|
81
76
|
id: '1',
|
82
77
|
body: { phrase: { default: 'foo', alt: 'bar' } }
|
83
78
|
}, done );
|
@@ -89,7 +84,6 @@ function phraseAssertion( analyzer, common ){
|
|
89
84
|
|
90
85
|
suite.client.indices.getMapping({
|
91
86
|
index: suite.props.index,
|
92
|
-
include_type_name: false
|
93
87
|
}, ( err, res ) => {
|
94
88
|
|
95
89
|
const properties = res[suite.props.index].mappings.properties;
|
@@ -110,13 +104,11 @@ function addendumAssertion( namespace, value, common ){
|
|
110
104
|
return function(t){
|
111
105
|
|
112
106
|
const suite = new Suite( common.clientOpts, common.create );
|
113
|
-
const _type = config.schema.typeName;
|
114
107
|
|
115
108
|
// index a document including the addendum
|
116
109
|
suite.action( done => {
|
117
110
|
suite.client.index({
|
118
111
|
index: suite.props.index,
|
119
|
-
type: _type,
|
120
112
|
id: '1',
|
121
113
|
body: { addendum: { [namespace]: value } },
|
122
114
|
}, done );
|
@@ -127,7 +119,6 @@ function addendumAssertion( namespace, value, common ){
|
|
127
119
|
suite.assert( done => {
|
128
120
|
suite.client.indices.getMapping({
|
129
121
|
index: suite.props.index,
|
130
|
-
include_type_name: false,
|
131
122
|
}, ( err, res ) => {
|
132
123
|
|
133
124
|
const properties = res[suite.props.index].mappings.properties;
|
@@ -156,7 +147,6 @@ function addendumAssertion( namespace, value, common ){
|
|
156
147
|
suite.assert( done => {
|
157
148
|
suite.client.get({
|
158
149
|
index: suite.props.index,
|
159
|
-
type: _type,
|
160
150
|
id: 1
|
161
151
|
}, ( err, res ) => {
|
162
152
|
t.false( err );
|
package/integration/run.js
CHANGED
@@ -15,28 +15,28 @@ module.exports.tests.source_filter = function(test, common){
|
|
15
15
|
// index some docs
|
16
16
|
suite.action( function( done ){
|
17
17
|
suite.client.index({
|
18
|
-
index: suite.props.index,
|
18
|
+
index: suite.props.index,
|
19
19
|
id: '1', body: { source: 'osm', layer: 'node', source_id: 'dataset/1' }
|
20
20
|
}, done );
|
21
21
|
});
|
22
22
|
|
23
23
|
suite.action( function( done ){
|
24
24
|
suite.client.index({
|
25
|
-
index: suite.props.index,
|
25
|
+
index: suite.props.index,
|
26
26
|
id: '2', body: { source: 'osm', layer: 'address', source_id: 'dataset/2' }
|
27
27
|
}, done );
|
28
28
|
});
|
29
29
|
|
30
30
|
suite.action( function( done ){
|
31
31
|
suite.client.index({
|
32
|
-
index: suite.props.index,
|
32
|
+
index: suite.props.index,
|
33
33
|
id: '3', body: { source: 'geonames', layer: 'address', source_id: 'dataset/1' }
|
34
34
|
}, done );
|
35
35
|
});
|
36
36
|
|
37
37
|
suite.action( function( done ){
|
38
38
|
suite.client.index({
|
39
|
-
index: suite.props.index,
|
39
|
+
index: suite.props.index,
|
40
40
|
id: '4', body: { source: 'foo bar baz' }
|
41
41
|
}, done );
|
42
42
|
});
|
@@ -45,7 +45,6 @@ module.exports.tests.source_filter = function(test, common){
|
|
45
45
|
suite.assert( function( done ){
|
46
46
|
suite.client.search({
|
47
47
|
index: suite.props.index,
|
48
|
-
type: config.schema.typeName,
|
49
48
|
body: { query: {
|
50
49
|
term: {
|
51
50
|
source: 'osm'
|
@@ -61,7 +60,6 @@ module.exports.tests.source_filter = function(test, common){
|
|
61
60
|
suite.assert( function( done ){
|
62
61
|
suite.client.search({
|
63
62
|
index: suite.props.index,
|
64
|
-
type: config.schema.typeName,
|
65
63
|
body: { query: {
|
66
64
|
term: {
|
67
65
|
layer: 'address'
|
@@ -77,7 +75,6 @@ module.exports.tests.source_filter = function(test, common){
|
|
77
75
|
suite.assert( function( done ){
|
78
76
|
suite.client.search({
|
79
77
|
index: suite.props.index,
|
80
|
-
type: config.schema.typeName,
|
81
78
|
body: { query: {
|
82
79
|
term: {
|
83
80
|
source_id: 'dataset/1'
|
@@ -93,7 +90,6 @@ module.exports.tests.source_filter = function(test, common){
|
|
93
90
|
suite.assert( function( done ){
|
94
91
|
suite.client.search({
|
95
92
|
index: suite.props.index,
|
96
|
-
type: config.schema.typeName,
|
97
93
|
body: { query: { bool: { must: [
|
98
94
|
{ term: { source: 'osm' } },
|
99
95
|
{ term: { source_id: 'dataset/1' } }
|
@@ -108,7 +104,6 @@ module.exports.tests.source_filter = function(test, common){
|
|
108
104
|
suite.assert( function( done ){
|
109
105
|
suite.client.search({
|
110
106
|
index: suite.props.index,
|
111
|
-
type: config.schema.typeName,
|
112
107
|
body: { query: {
|
113
108
|
term: {
|
114
109
|
source: 'OSM'
|
@@ -124,7 +119,6 @@ module.exports.tests.source_filter = function(test, common){
|
|
124
119
|
suite.assert( function( done ){
|
125
120
|
suite.client.search({
|
126
121
|
index: suite.props.index,
|
127
|
-
type: config.schema.typeName,
|
128
122
|
body: { query: {
|
129
123
|
term: {
|
130
124
|
source: 'foo'
|
@@ -140,7 +134,6 @@ module.exports.tests.source_filter = function(test, common){
|
|
140
134
|
suite.assert( function( done ){
|
141
135
|
suite.client.search({
|
142
136
|
index: suite.props.index,
|
143
|
-
type: config.schema.typeName,
|
144
137
|
body: { query: {
|
145
138
|
term: {
|
146
139
|
source: 'foo bar baz'
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "pelias-schema",
|
3
|
-
"version": "
|
3
|
+
"version": "7.0.0",
|
4
4
|
"author": "pelias",
|
5
5
|
"description": "Elasticsearch schema files and tooling for Pelias",
|
6
6
|
"homepage": "https://github.com/pelias/schema",
|
@@ -11,7 +11,6 @@
|
|
11
11
|
"integration": "./bin/integration",
|
12
12
|
"create_index": "./bin/create_index",
|
13
13
|
"drop_index": "node scripts/drop_index",
|
14
|
-
"reset_type": "node scripts/reset_type",
|
15
14
|
"update_settings": "node scripts/update_settings"
|
16
15
|
},
|
17
16
|
"repository": {
|
@@ -34,7 +33,7 @@
|
|
34
33
|
"elasticsearch": "^16.0.0",
|
35
34
|
"glob": "^7.1.6",
|
36
35
|
"lodash": "^4.17.15",
|
37
|
-
"pelias-config": "^
|
36
|
+
"pelias-config": "^6.0.0",
|
38
37
|
"pelias-logger": "^1.3.0",
|
39
38
|
"semver": "^7.1.1"
|
40
39
|
},
|
package/scripts/check_plugins.js
CHANGED
@@ -10,15 +10,6 @@ const required = ['analysis-icu'];
|
|
10
10
|
// list of failures
|
11
11
|
let failures = [];
|
12
12
|
|
13
|
-
// returns the appropriate plugin name for the configured Elasticsearch version
|
14
|
-
function elasticsearchPluginUtility() {
|
15
|
-
if (config.esclient.apiVersion === '2.4') {
|
16
|
-
return 'plugin';
|
17
|
-
} else {
|
18
|
-
return 'elasticsearch-plugin';
|
19
|
-
}
|
20
|
-
}
|
21
|
-
|
22
13
|
cli.header("checking elasticsearch plugins");
|
23
14
|
client.nodes.info(null, (err, res) => {
|
24
15
|
|
@@ -76,7 +67,7 @@ client.nodes.info(null, (err, res) => {
|
|
76
67
|
failures.forEach(failure => {
|
77
68
|
console.error( `\nyou can install the missing packages on '${failure.node.name}' [${failure.node.ip}] with the following command(s):\n` );
|
78
69
|
failure.plugins.forEach(plugin => {
|
79
|
-
console.error( colors.green( `sudo ${failure.node.settings.path.home}/bin
|
70
|
+
console.error( colors.green( `sudo ${failure.node.settings.path.home}/bin/elasticsearch-plugin install ${plugin}`) );
|
80
71
|
});
|
81
72
|
});
|
82
73
|
console.error( colors.white("\nnote:") + "some plugins may require you to restart elasticsearch.\n");
|
package/scripts/create_index.js
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
const _ = require('lodash')
|
2
2
|
const colors = require('colors')
|
3
3
|
const cli = require('./cli');
|
4
|
-
const config = require('pelias-config').generate();
|
5
4
|
const schema = require('../schema');
|
6
5
|
const DEFAULT_ANALYZER = 'standard';
|
7
6
|
const NOT_APPLICABLE_ANALYZER = 'n/a';
|
@@ -54,7 +53,7 @@ const error = function(vals) {
|
|
54
53
|
}
|
55
54
|
|
56
55
|
// parse mapping
|
57
|
-
const mapping = schema.mappings
|
56
|
+
const mapping = schema.mappings;
|
58
57
|
const dynamic = mapping.dynamic_templates.map(t => _.first(_.map(t, v => v)));
|
59
58
|
|
60
59
|
// process and single mapping property (recursively)
|
@@ -1,21 +1,4 @@
|
|
1
|
-
var config = require('pelias-config').generate();
|
2
|
-
var es = require('elasticsearch');
|
3
|
-
var client = new es.Client(config.esclient);
|
4
1
|
var schema = require('../schema');
|
5
2
|
|
6
|
-
|
7
|
-
var _type = ( process.argv.length > 2 ) ? process.argv[2] : null; // get type from cli args
|
8
|
-
|
9
|
-
// print out mapping for just one type
|
10
|
-
if ( _type ) {
|
11
|
-
var mapping = schema.mappings[_type];
|
12
|
-
if( !mapping ){
|
13
|
-
console.error( 'could not find a mapping in the schema file for', _index+'/'+_type );
|
14
|
-
process.exit(1);
|
15
|
-
}
|
16
|
-
console.log( JSON.stringify( mapping, null, 2 ) );
|
17
|
-
//print out the entire schema mapping
|
18
|
-
} else {
|
19
|
-
console.log( JSON.stringify( schema, null, 2 ) );
|
20
|
-
}
|
3
|
+
console.log( JSON.stringify( schema.mappings, null, 2 ) );
|
21
4
|
|
package/settings.js
CHANGED
package/test/configValidation.js
CHANGED
@@ -19,7 +19,7 @@ module.exports.tests.interface = function(test, common) {
|
|
19
19
|
|
20
20
|
test('config without schema.indexName should throw error', function(t) {
|
21
21
|
var config = {
|
22
|
-
schema: {
|
22
|
+
schema: {},
|
23
23
|
esclient: {}
|
24
24
|
};
|
25
25
|
|
@@ -30,25 +30,11 @@ module.exports.tests.interface = function(test, common) {
|
|
30
30
|
|
31
31
|
});
|
32
32
|
|
33
|
-
test('config without schema.typeName should throw error', function (t) {
|
34
|
-
var config = {
|
35
|
-
schema: { indexName: 'example_index' },
|
36
|
-
esclient: {}
|
37
|
-
};
|
38
|
-
|
39
|
-
t.throws(function () {
|
40
|
-
configValidation.validate(config);
|
41
|
-
}, /"schema.typeName" is required/, 'schema.typeName should exist');
|
42
|
-
t.end();
|
43
|
-
|
44
|
-
});
|
45
|
-
|
46
33
|
test('config with non-string schema.indexName should throw error', function(t) {
|
47
34
|
[null, 17, {}, [], false].forEach((value) => {
|
48
35
|
var config = {
|
49
36
|
schema: {
|
50
37
|
indexName: value,
|
51
|
-
typeName: 'example_type'
|
52
38
|
},
|
53
39
|
esclient: {}
|
54
40
|
};
|
@@ -63,32 +49,11 @@ module.exports.tests.interface = function(test, common) {
|
|
63
49
|
|
64
50
|
});
|
65
51
|
|
66
|
-
test('config with non-string schema.typeName should throw error', function (t) {
|
67
|
-
[null, 17, {}, [], false].forEach((value) => {
|
68
|
-
var config = {
|
69
|
-
schema: {
|
70
|
-
indexName: 'example_index',
|
71
|
-
typeName: value
|
72
|
-
},
|
73
|
-
esclient: {}
|
74
|
-
};
|
75
|
-
|
76
|
-
t.throws(function () {
|
77
|
-
configValidation.validate(config);
|
78
|
-
}, /"schema.typeName" must be a string/, 'schema.typeName should be a string');
|
79
|
-
|
80
|
-
});
|
81
|
-
|
82
|
-
t.end();
|
83
|
-
|
84
|
-
});
|
85
|
-
|
86
52
|
test('config with non-object esclient should throw error', function(t) {
|
87
53
|
[null, 17, [], 'string', true].forEach((value) => {
|
88
54
|
var config = {
|
89
55
|
schema: {
|
90
56
|
indexName: 'example_index',
|
91
|
-
typeName: 'example_type'
|
92
57
|
},
|
93
58
|
esclient: value
|
94
59
|
};
|
@@ -107,7 +72,6 @@ module.exports.tests.interface = function(test, common) {
|
|
107
72
|
var config = {
|
108
73
|
schema: {
|
109
74
|
indexName: 'example_index',
|
110
|
-
typeName: 'example_type'
|
111
75
|
},
|
112
76
|
esclient: {}
|
113
77
|
};
|
@@ -248,7 +248,7 @@
|
|
248
248
|
"only_on_same_position": "true"
|
249
249
|
},
|
250
250
|
"peliasOneEdgeGramFilter": {
|
251
|
-
"type": "
|
251
|
+
"type": "edge_ngram",
|
252
252
|
"min_gram": 1,
|
253
253
|
"max_gram": 24
|
254
254
|
},
|
@@ -2415,8 +2415,7 @@
|
|
2415
2415
|
"type": "text",
|
2416
2416
|
"analyzer": "peliasIndexOneEdgeGram",
|
2417
2417
|
"search_analyzer": "peliasAdmin",
|
2418
|
-
"similarity": "peliasDefaultSimilarity"
|
2419
|
-
"doc_values": false
|
2418
|
+
"similarity": "peliasDefaultSimilarity"
|
2420
2419
|
}
|
2421
2420
|
}
|
2422
2421
|
},
|
@@ -2430,8 +2429,7 @@
|
|
2430
2429
|
"type": "text",
|
2431
2430
|
"analyzer": "peliasIndexOneEdgeGram",
|
2432
2431
|
"search_analyzer": "peliasAdmin",
|
2433
|
-
"similarity": "peliasDefaultSimilarity"
|
2434
|
-
"doc_values": false
|
2432
|
+
"similarity": "peliasDefaultSimilarity"
|
2435
2433
|
}
|
2436
2434
|
}
|
2437
2435
|
},
|
@@ -2453,8 +2451,7 @@
|
|
2453
2451
|
"type": "text",
|
2454
2452
|
"analyzer": "peliasIndexOneEdgeGram",
|
2455
2453
|
"search_analyzer": "peliasAdmin",
|
2456
|
-
"similarity": "peliasDefaultSimilarity"
|
2457
|
-
"doc_values": false
|
2454
|
+
"similarity": "peliasDefaultSimilarity"
|
2458
2455
|
}
|
2459
2456
|
}
|
2460
2457
|
},
|
@@ -2468,8 +2465,7 @@
|
|
2468
2465
|
"type": "text",
|
2469
2466
|
"analyzer": "peliasIndexOneEdgeGram",
|
2470
2467
|
"search_analyzer": "peliasAdmin",
|
2471
|
-
"similarity": "peliasDefaultSimilarity"
|
2472
|
-
"doc_values": false
|
2468
|
+
"similarity": "peliasDefaultSimilarity"
|
2473
2469
|
}
|
2474
2470
|
}
|
2475
2471
|
},
|
@@ -2491,8 +2487,7 @@
|
|
2491
2487
|
"type": "text",
|
2492
2488
|
"analyzer": "peliasIndexOneEdgeGram",
|
2493
2489
|
"search_analyzer": "peliasAdmin",
|
2494
|
-
"similarity": "peliasDefaultSimilarity"
|
2495
|
-
"doc_values": false
|
2490
|
+
"similarity": "peliasDefaultSimilarity"
|
2496
2491
|
}
|
2497
2492
|
}
|
2498
2493
|
},
|
@@ -2506,8 +2501,7 @@
|
|
2506
2501
|
"type": "text",
|
2507
2502
|
"analyzer": "peliasIndexOneEdgeGram",
|
2508
2503
|
"search_analyzer": "peliasAdmin",
|
2509
|
-
"similarity": "peliasDefaultSimilarity"
|
2510
|
-
"doc_values": false
|
2504
|
+
"similarity": "peliasDefaultSimilarity"
|
2511
2505
|
}
|
2512
2506
|
}
|
2513
2507
|
},
|
@@ -2529,8 +2523,7 @@
|
|
2529
2523
|
"type": "text",
|
2530
2524
|
"analyzer": "peliasIndexOneEdgeGram",
|
2531
2525
|
"search_analyzer": "peliasAdmin",
|
2532
|
-
"similarity": "peliasDefaultSimilarity"
|
2533
|
-
"doc_values": false
|
2526
|
+
"similarity": "peliasDefaultSimilarity"
|
2534
2527
|
}
|
2535
2528
|
}
|
2536
2529
|
},
|
@@ -2544,8 +2537,7 @@
|
|
2544
2537
|
"type": "text",
|
2545
2538
|
"analyzer": "peliasIndexCountryAbbreviationOneEdgeGram",
|
2546
2539
|
"search_analyzer": "peliasQuery",
|
2547
|
-
"similarity": "peliasDefaultSimilarity"
|
2548
|
-
"doc_values": false
|
2540
|
+
"similarity": "peliasDefaultSimilarity"
|
2549
2541
|
}
|
2550
2542
|
}
|
2551
2543
|
},
|
@@ -2567,8 +2559,7 @@
|
|
2567
2559
|
"type": "text",
|
2568
2560
|
"analyzer": "peliasIndexOneEdgeGram",
|
2569
2561
|
"search_analyzer": "peliasAdmin",
|
2570
|
-
"similarity": "peliasDefaultSimilarity"
|
2571
|
-
"doc_values": false
|
2562
|
+
"similarity": "peliasDefaultSimilarity"
|
2572
2563
|
}
|
2573
2564
|
}
|
2574
2565
|
},
|
@@ -2582,8 +2573,7 @@
|
|
2582
2573
|
"type": "text",
|
2583
2574
|
"analyzer": "peliasIndexOneEdgeGram",
|
2584
2575
|
"search_analyzer": "peliasAdmin",
|
2585
|
-
"similarity": "peliasDefaultSimilarity"
|
2586
|
-
"doc_values": false
|
2576
|
+
"similarity": "peliasDefaultSimilarity"
|
2587
2577
|
}
|
2588
2578
|
}
|
2589
2579
|
},
|
@@ -2605,8 +2595,7 @@
|
|
2605
2595
|
"type": "text",
|
2606
2596
|
"analyzer": "peliasIndexOneEdgeGram",
|
2607
2597
|
"search_analyzer": "peliasAdmin",
|
2608
|
-
"similarity": "peliasDefaultSimilarity"
|
2609
|
-
"doc_values": false
|
2598
|
+
"similarity": "peliasDefaultSimilarity"
|
2610
2599
|
}
|
2611
2600
|
}
|
2612
2601
|
},
|
@@ -2620,8 +2609,7 @@
|
|
2620
2609
|
"type": "text",
|
2621
2610
|
"analyzer": "peliasIndexOneEdgeGram",
|
2622
2611
|
"search_analyzer": "peliasAdmin",
|
2623
|
-
"similarity": "peliasDefaultSimilarity"
|
2624
|
-
"doc_values": false
|
2612
|
+
"similarity": "peliasDefaultSimilarity"
|
2625
2613
|
}
|
2626
2614
|
}
|
2627
2615
|
},
|
@@ -2643,8 +2631,7 @@
|
|
2643
2631
|
"type": "text",
|
2644
2632
|
"analyzer": "peliasIndexOneEdgeGram",
|
2645
2633
|
"search_analyzer": "peliasAdmin",
|
2646
|
-
"similarity": "peliasDefaultSimilarity"
|
2647
|
-
"doc_values": false
|
2634
|
+
"similarity": "peliasDefaultSimilarity"
|
2648
2635
|
}
|
2649
2636
|
}
|
2650
2637
|
},
|
@@ -2658,8 +2645,7 @@
|
|
2658
2645
|
"type": "text",
|
2659
2646
|
"analyzer": "peliasIndexOneEdgeGram",
|
2660
2647
|
"search_analyzer": "peliasAdmin",
|
2661
|
-
"similarity": "peliasDefaultSimilarity"
|
2662
|
-
"doc_values": false
|
2648
|
+
"similarity": "peliasDefaultSimilarity"
|
2663
2649
|
}
|
2664
2650
|
}
|
2665
2651
|
},
|
@@ -2681,8 +2667,7 @@
|
|
2681
2667
|
"type": "text",
|
2682
2668
|
"analyzer": "peliasIndexOneEdgeGram",
|
2683
2669
|
"search_analyzer": "peliasAdmin",
|
2684
|
-
"similarity": "peliasDefaultSimilarity"
|
2685
|
-
"doc_values": false
|
2670
|
+
"similarity": "peliasDefaultSimilarity"
|
2686
2671
|
}
|
2687
2672
|
}
|
2688
2673
|
},
|
@@ -2696,8 +2681,7 @@
|
|
2696
2681
|
"type": "text",
|
2697
2682
|
"analyzer": "peliasIndexOneEdgeGram",
|
2698
2683
|
"search_analyzer": "peliasAdmin",
|
2699
|
-
"similarity": "peliasDefaultSimilarity"
|
2700
|
-
"doc_values": false
|
2684
|
+
"similarity": "peliasDefaultSimilarity"
|
2701
2685
|
}
|
2702
2686
|
}
|
2703
2687
|
},
|
@@ -2719,8 +2703,7 @@
|
|
2719
2703
|
"type": "text",
|
2720
2704
|
"analyzer": "peliasIndexOneEdgeGram",
|
2721
2705
|
"search_analyzer": "peliasAdmin",
|
2722
|
-
"similarity": "peliasDefaultSimilarity"
|
2723
|
-
"doc_values": false
|
2706
|
+
"similarity": "peliasDefaultSimilarity"
|
2724
2707
|
}
|
2725
2708
|
}
|
2726
2709
|
},
|
@@ -2734,8 +2717,7 @@
|
|
2734
2717
|
"type": "text",
|
2735
2718
|
"analyzer": "peliasIndexOneEdgeGram",
|
2736
2719
|
"search_analyzer": "peliasAdmin",
|
2737
|
-
"similarity": "peliasDefaultSimilarity"
|
2738
|
-
"doc_values": false
|
2720
|
+
"similarity": "peliasDefaultSimilarity"
|
2739
2721
|
}
|
2740
2722
|
}
|
2741
2723
|
},
|
@@ -2757,8 +2739,7 @@
|
|
2757
2739
|
"type": "text",
|
2758
2740
|
"analyzer": "peliasIndexOneEdgeGram",
|
2759
2741
|
"search_analyzer": "peliasAdmin",
|
2760
|
-
"similarity": "peliasDefaultSimilarity"
|
2761
|
-
"doc_values": false
|
2742
|
+
"similarity": "peliasDefaultSimilarity"
|
2762
2743
|
}
|
2763
2744
|
}
|
2764
2745
|
},
|
@@ -2772,8 +2753,7 @@
|
|
2772
2753
|
"type": "text",
|
2773
2754
|
"analyzer": "peliasIndexOneEdgeGram",
|
2774
2755
|
"search_analyzer": "peliasAdmin",
|
2775
|
-
"similarity": "peliasDefaultSimilarity"
|
2776
|
-
"doc_values": false
|
2756
|
+
"similarity": "peliasDefaultSimilarity"
|
2777
2757
|
}
|
2778
2758
|
}
|
2779
2759
|
},
|
@@ -2795,8 +2775,7 @@
|
|
2795
2775
|
"type": "text",
|
2796
2776
|
"analyzer": "peliasIndexOneEdgeGram",
|
2797
2777
|
"search_analyzer": "peliasAdmin",
|
2798
|
-
"similarity": "peliasDefaultSimilarity"
|
2799
|
-
"doc_values": false
|
2778
|
+
"similarity": "peliasDefaultSimilarity"
|
2800
2779
|
}
|
2801
2780
|
}
|
2802
2781
|
},
|
@@ -2810,8 +2789,7 @@
|
|
2810
2789
|
"type": "text",
|
2811
2790
|
"analyzer": "peliasIndexOneEdgeGram",
|
2812
2791
|
"search_analyzer": "peliasAdmin",
|
2813
|
-
"similarity": "peliasDefaultSimilarity"
|
2814
|
-
"doc_values": false
|
2792
|
+
"similarity": "peliasDefaultSimilarity"
|
2815
2793
|
}
|
2816
2794
|
}
|
2817
2795
|
},
|
@@ -2833,8 +2811,7 @@
|
|
2833
2811
|
"type": "text",
|
2834
2812
|
"analyzer": "peliasIndexOneEdgeGram",
|
2835
2813
|
"search_analyzer": "peliasAdmin",
|
2836
|
-
"similarity": "peliasDefaultSimilarity"
|
2837
|
-
"doc_values": false
|
2814
|
+
"similarity": "peliasDefaultSimilarity"
|
2838
2815
|
}
|
2839
2816
|
}
|
2840
2817
|
},
|
@@ -2848,8 +2825,7 @@
|
|
2848
2825
|
"type": "text",
|
2849
2826
|
"analyzer": "peliasIndexOneEdgeGram",
|
2850
2827
|
"search_analyzer": "peliasAdmin",
|
2851
|
-
"similarity": "peliasDefaultSimilarity"
|
2852
|
-
"doc_values": false
|
2828
|
+
"similarity": "peliasDefaultSimilarity"
|
2853
2829
|
}
|
2854
2830
|
}
|
2855
2831
|
},
|
@@ -2871,8 +2847,7 @@
|
|
2871
2847
|
"type": "text",
|
2872
2848
|
"analyzer": "peliasIndexOneEdgeGram",
|
2873
2849
|
"search_analyzer": "peliasAdmin",
|
2874
|
-
"similarity": "peliasDefaultSimilarity"
|
2875
|
-
"doc_values": false
|
2850
|
+
"similarity": "peliasDefaultSimilarity"
|
2876
2851
|
}
|
2877
2852
|
}
|
2878
2853
|
},
|
@@ -2886,8 +2861,7 @@
|
|
2886
2861
|
"type": "text",
|
2887
2862
|
"analyzer": "peliasIndexOneEdgeGram",
|
2888
2863
|
"search_analyzer": "peliasAdmin",
|
2889
|
-
"similarity": "peliasDefaultSimilarity"
|
2890
|
-
"doc_values": false
|
2864
|
+
"similarity": "peliasDefaultSimilarity"
|
2891
2865
|
}
|
2892
2866
|
}
|
2893
2867
|
},
|
@@ -2909,8 +2883,7 @@
|
|
2909
2883
|
"type": "text",
|
2910
2884
|
"analyzer": "peliasIndexOneEdgeGram",
|
2911
2885
|
"search_analyzer": "peliasAdmin",
|
2912
|
-
"similarity": "peliasDefaultSimilarity"
|
2913
|
-
"doc_values": false
|
2886
|
+
"similarity": "peliasDefaultSimilarity"
|
2914
2887
|
}
|
2915
2888
|
}
|
2916
2889
|
},
|
@@ -2924,8 +2897,7 @@
|
|
2924
2897
|
"type": "text",
|
2925
2898
|
"analyzer": "peliasIndexOneEdgeGram",
|
2926
2899
|
"search_analyzer": "peliasAdmin",
|
2927
|
-
"similarity": "peliasDefaultSimilarity"
|
2928
|
-
"doc_values": false
|
2900
|
+
"similarity": "peliasDefaultSimilarity"
|
2929
2901
|
}
|
2930
2902
|
}
|
2931
2903
|
},
|
package/test/settings.js
CHANGED
@@ -490,7 +490,7 @@ module.exports.tests.peliasOneEdgeGramFilter = function(test, common) {
|
|
490
490
|
var s = settings();
|
491
491
|
t.equal(typeof s.analysis.filter.peliasOneEdgeGramFilter, 'object', 'there is a peliasIndexOneEdgeGram filter');
|
492
492
|
var filter = s.analysis.filter.peliasOneEdgeGramFilter;
|
493
|
-
t.equal(filter.type, '
|
493
|
+
t.equal(filter.type, 'edge_ngram');
|
494
494
|
t.equal(filter.min_gram, 1);
|
495
495
|
t.equal(filter.max_gram, 24);
|
496
496
|
t.end();
|
package/scripts/reset_type.js
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
var config = require('pelias-config').generate().esclient;
|
2
|
-
var es = require('elasticsearch');
|
3
|
-
var client = new es.Client(config);
|
4
|
-
var schema = require('../schema');
|
5
|
-
|
6
|
-
var _index = ( process.argv.length > 3 ) ? process.argv[3] : config.schema.indexName;
|
7
|
-
var _type = ( process.argv.length > 2 ) ? process.argv[2] : null; // get type from cli args
|
8
|
-
|
9
|
-
if( !_type ){
|
10
|
-
console.error( 'you must provide the target es \'type\' as the first cli argument' );
|
11
|
-
process.exit(1);
|
12
|
-
}
|
13
|
-
|
14
|
-
var mapping = schema.mappings[_type];
|
15
|
-
if( !mapping ){
|
16
|
-
console.error( 'could not find a mapping in the schema file for', _index+'/'+_type );
|
17
|
-
process.exit(1);
|
18
|
-
}
|
19
|
-
|
20
|
-
client.indices.deleteMapping( { index: _index, type: _type }, function( err, res ){
|
21
|
-
console.log( '[delete mapping]', '\t', _index+'/'+_type, err || '\t', res );
|
22
|
-
client.indices.putMapping( { index: _index, type: _type, body:mapping }, function( err, res ){
|
23
|
-
console.log( '[put mapping]', '\t\t', _index+'/'+_type, err || '\t', res );
|
24
|
-
process.exit( !!err );
|
25
|
-
});
|
26
|
-
});
|