pelias-schema 6.7.0 → 7.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. package/README.md +1 -1
  2. package/configValidation.js +0 -1
  3. package/integration/address_matching.js +3 -19
  4. package/integration/admin_abbreviations.js +4 -19
  5. package/integration/admin_matching.js +2 -6
  6. package/integration/analyzer_peliasAdmin.js +6 -6
  7. package/integration/analyzer_peliasHousenumber.js +3 -3
  8. package/integration/analyzer_peliasIndexOneEdgeGram.js +8 -8
  9. package/integration/analyzer_peliasPhrase.js +8 -13
  10. package/integration/analyzer_peliasQuery.js +5 -5
  11. package/integration/analyzer_peliasStreet.js +8 -8
  12. package/integration/analyzer_peliasZip.js +3 -3
  13. package/integration/autocomplete_abbreviated_street_names.js +3 -8
  14. package/integration/autocomplete_directional_synonym_expansion.js +5 -15
  15. package/integration/autocomplete_street_synonym_expansion.js +5 -15
  16. package/integration/bounding_box.js +2 -4
  17. package/integration/dynamic_templates.js +4 -14
  18. package/integration/multi_token_synonyms.js +2 -3
  19. package/integration/run.js +1 -3
  20. package/integration/source_layer_sourceid_filtering.js +6 -13
  21. package/integration/validate.js +2 -2
  22. package/mappings/partial/admin.json +1 -2
  23. package/mappings/partial/countryAbbreviation.json +1 -2
  24. package/package.json +4 -4
  25. package/scripts/check_plugins.js +1 -10
  26. package/scripts/create_index.js +0 -1
  27. package/scripts/list_analyzers.js +1 -2
  28. package/scripts/output_mapping.js +1 -18
  29. package/settings.js +1 -1
  30. package/test/configValidation.js +1 -37
  31. package/test/elastictest/Suite.js +103 -0
  32. package/test/fixtures/expected.json +29 -57
  33. package/test/settings.js +1 -1
  34. 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 whole schema file or a single mapping to stdout.
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
@@ -6,7 +6,6 @@ const Joi = require('@hapi/joi');
6
6
  const schema = Joi.object().required().keys({
7
7
  schema: Joi.object().required().keys({
8
8
  indexName: Joi.string().required(),
9
- typeName: Joi.string().required()
10
9
  }),
11
10
  esclient: Joi.object().required()
12
11
  }).unknown(true);
@@ -1,6 +1,6 @@
1
1
  // validate analyzer is behaving as expected
2
2
 
3
- const elastictest = require('elastictest');
3
+ const Suite = require('../test/elastictest/Suite');
4
4
  const config = require('pelias-config').generate();
5
5
  const getTotalHits = require('./_hits_total_helper');
6
6
 
@@ -9,14 +9,13 @@ module.exports.tests = {};
9
9
  module.exports.tests.functional = function(test, common){
10
10
  test( 'functional', function(t){
11
11
 
12
- var suite = new elastictest.Suite( common.clientOpts, common.create );
12
+ var suite = new Suite( common.clientOpts, common.create );
13
13
  suite.action( function( done ){ setTimeout( done, 500 ); }); // wait for es to bring some shards up
14
14
 
15
15
  // index some docs
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
  ]}}}
@@ -217,14 +204,13 @@ module.exports.tests.venue_vs_address = function(test, common){
217
204
  // Unfortunately there seems to be no easy way of fixing this, it's an artifact of us
218
205
  // storing the street names in the name.default field.
219
206
 
220
- var suite = new elastictest.Suite( common.clientOpts, common.create );
207
+ var suite = new Suite( common.clientOpts, common.create );
221
208
  suite.action( function( done ){ setTimeout( done, 500 ); }); // wait for es to bring some shards up
222
209
 
223
210
  // index a venue
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: {
@@ -1,4 +1,4 @@
1
- const elastictest = require('elastictest');
1
+ const Suite = require('../test/elastictest/Suite');
2
2
  const config = require('pelias-config').generate();
3
3
  const getTotalHits = require('./_hits_total_helper');
4
4
 
@@ -12,14 +12,13 @@ module.exports.tests = {};
12
12
  module.exports.tests.synonyms = function (test, common) {
13
13
  test('synonyms - alpha3 does not share a prefix with alpha2', function (t) {
14
14
 
15
- var suite = new elastictest.Suite(common.clientOpts, common.create);
15
+ var suite = new Suite(common.clientOpts, common.create);
16
16
  suite.action(done => setTimeout(done, 500)); // wait for es to bring some shards up
17
17
 
18
18
  // index document 1 with country_a='MEX'
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: {
@@ -140,14 +134,13 @@ module.exports.tests.synonyms = function (test, common) {
140
134
 
141
135
  test('synonyms - alpha3 shares a prefix with alpha2', function (t) {
142
136
 
143
- var suite = new elastictest.Suite(common.clientOpts, common.create);
137
+ var suite = new Suite(common.clientOpts, common.create);
144
138
  suite.action(done => setTimeout(done, 500)); // wait for es to bring some shards up
145
139
 
146
140
  // index document 1 with country_a='NZL'
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: {
@@ -268,14 +256,13 @@ module.exports.tests.synonyms = function (test, common) {
268
256
 
269
257
  test('synonyms - additional synonyms do not increase field length', function (t) {
270
258
 
271
- var suite = new elastictest.Suite(common.clientOpts, common.create);
259
+ var suite = new Suite(common.clientOpts, common.create);
272
260
  suite.action(done => setTimeout(done, 500)); // wait for es to bring some shards up
273
261
 
274
262
  // index document 1 with country_a='NZL'
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: {
@@ -1,6 +1,6 @@
1
1
  // validate analyzer is behaving as expected
2
2
 
3
- const elastictest = require('elastictest');
3
+ const Suite = require('../test/elastictest/Suite');
4
4
  const config = require('pelias-config').generate();
5
5
  const getTotalHits = require('./_hits_total_helper');
6
6
 
@@ -9,14 +9,13 @@ module.exports.tests = {};
9
9
  module.exports.tests.functional = function(test, common){
10
10
  test( 'functional', function(t){
11
11
 
12
- var suite = new elastictest.Suite( common.clientOpts, common.create );
12
+ var suite = new Suite( common.clientOpts, common.create );
13
13
  suite.action( function( done ){ setTimeout( done, 500 ); }); // wait for es to bring some shards up
14
14
 
15
15
  // index a document with all admin values
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 );
@@ -1,7 +1,7 @@
1
1
  // validate analyzer is behaving as expected
2
2
 
3
3
  var tape = require('tape'),
4
- elastictest = require('elastictest'),
4
+ Suite = require('../test/elastictest/Suite'),
5
5
  punctuation = require('../punctuation');
6
6
 
7
7
  module.exports.tests = {};
@@ -9,7 +9,7 @@ module.exports.tests = {};
9
9
  module.exports.tests.analyze = function(test, common){
10
10
  test( 'analyze', function(t){
11
11
 
12
- var suite = new elastictest.Suite( common.clientOpts, common.create );
12
+ var suite = new Suite( common.clientOpts, common.create );
13
13
  var assertAnalysis = common.analyze.bind( null, suite, t, 'peliasAdmin' );
14
14
  suite.action( function( done ){ setTimeout( done, 500 ); }); // wait for es to bring some shards up
15
15
 
@@ -33,7 +33,7 @@ module.exports.tests.analyze = function(test, common){
33
33
  module.exports.tests.functional = function(test, common){
34
34
  test( 'functional', function(t){
35
35
 
36
- var suite = new elastictest.Suite( common.clientOpts, common.create );
36
+ var suite = new Suite( common.clientOpts, common.create );
37
37
  var assertAnalysis = common.analyze.bind( null, suite, t, 'peliasAdmin' );
38
38
  suite.action( function( done ){ setTimeout( done, 500 ); }); // wait for es to bring some shards up
39
39
 
@@ -71,7 +71,7 @@ module.exports.tests.functional = function(test, common){
71
71
  module.exports.tests.synonyms = function(test, common){
72
72
  test( 'synonyms', function(t){
73
73
 
74
- var suite = new elastictest.Suite( common.clientOpts, common.create );
74
+ var suite = new Suite( common.clientOpts, common.create );
75
75
  var assertAnalysis = common.analyze.bind( null, suite, t, 'peliasAdmin' );
76
76
  suite.action( function( done ){ setTimeout( done, 500 ); }); // wait for es to bring some shards up
77
77
 
@@ -98,7 +98,7 @@ module.exports.tests.synonyms = function(test, common){
98
98
  module.exports.tests.tokenizer = function(test, common){
99
99
  test( 'tokenizer', function(t){
100
100
 
101
- var suite = new elastictest.Suite( common.clientOpts, common.create );
101
+ var suite = new Suite( common.clientOpts, common.create );
102
102
  var assertAnalysis = common.analyze.bind( null, suite, t, 'peliasAdmin' );
103
103
  suite.action( function( done ){ setTimeout( done, 500 ); }); // wait for es to bring some shards up
104
104
 
@@ -126,7 +126,7 @@ module.exports.tests.tokenizer = function(test, common){
126
126
  module.exports.tests.unicode = function(test, common){
127
127
  test( 'normalization', function(t){
128
128
 
129
- var suite = new elastictest.Suite( common.clientOpts, common.create );
129
+ var suite = new Suite( common.clientOpts, common.create );
130
130
  var assertAnalysis = common.analyze.bind( null, suite, t, 'peliasAdmin' );
131
131
  suite.action( function( done ){ setTimeout( done, 500 ); }); // wait for es to bring some shards up
132
132
 
@@ -1,7 +1,7 @@
1
1
  // validate analyzer is behaving as expected
2
2
 
3
3
  var tape = require('tape'),
4
- elastictest = require('elastictest'),
4
+ Suite = require('../test/elastictest/Suite'),
5
5
  punctuation = require('../punctuation');
6
6
 
7
7
  module.exports.tests = {};
@@ -9,7 +9,7 @@ module.exports.tests = {};
9
9
  module.exports.tests.analyze = function(test, common){
10
10
  test( 'analyze', function(t){
11
11
 
12
- var suite = new elastictest.Suite( common.clientOpts, common.create );
12
+ var suite = new Suite( common.clientOpts, common.create );
13
13
  var assertAnalysis = common.analyze.bind( null, suite, t, 'peliasHousenumber' );
14
14
  suite.action( function( done ){ setTimeout( done, 500 ); }); // wait for es to bring some shards up
15
15
 
@@ -23,7 +23,7 @@ module.exports.tests.analyze = function(test, common){
23
23
  module.exports.tests.functional = function(test, common){
24
24
  test( 'functional', function(t){
25
25
 
26
- var suite = new elastictest.Suite( common.clientOpts, common.create );
26
+ var suite = new Suite( common.clientOpts, common.create );
27
27
  var assertAnalysis = common.analyze.bind( null, suite, t, 'peliasHousenumber' );
28
28
  suite.action( function( done ){ setTimeout( done, 500 ); }); // wait for es to bring some shards up
29
29
 
@@ -1,7 +1,7 @@
1
1
  // validate analyzer is behaving as expected
2
2
 
3
3
  var tape = require('tape'),
4
- elastictest = require('elastictest'),
4
+ Suite = require('../test/elastictest/Suite'),
5
5
  punctuation = require('../punctuation');
6
6
 
7
7
  module.exports.tests = {};
@@ -9,7 +9,7 @@ module.exports.tests = {};
9
9
  module.exports.tests.analyze = function(test, common){
10
10
  test( 'analyze', function(t){
11
11
 
12
- var suite = new elastictest.Suite( common.clientOpts, common.create );
12
+ var suite = new Suite( common.clientOpts, common.create );
13
13
  var assertAnalysis = common.analyze.bind( null, suite, t, 'peliasIndexOneEdgeGram' );
14
14
  suite.action( function( done ){ setTimeout( done, 500 ); }); // wait for es to bring some shards up
15
15
 
@@ -95,7 +95,7 @@ module.exports.tests.analyze = function(test, common){
95
95
  module.exports.tests.address_suffix_expansions = function(test, common){
96
96
  test( 'address suffix expansions', function(t){
97
97
 
98
- var suite = new elastictest.Suite( common.clientOpts, common.create );
98
+ var suite = new Suite( common.clientOpts, common.create );
99
99
  var assertAnalysis = common.analyze.bind( null, suite, t, 'peliasIndexOneEdgeGram' );
100
100
  suite.action( function( done ){ setTimeout( done, 500 ); }); // wait for es to bring some shards up
101
101
 
@@ -125,7 +125,7 @@ module.exports.tests.address_suffix_expansions = function(test, common){
125
125
  module.exports.tests.stop_words = function(test, common){
126
126
  test( 'stop words', function(t){
127
127
 
128
- var suite = new elastictest.Suite( common.clientOpts, common.create );
128
+ var suite = new Suite( common.clientOpts, common.create );
129
129
  var assertAnalysis = common.analyze.bind( null, suite, t, 'peliasIndexOneEdgeGram' );
130
130
  suite.action( function( done ){ setTimeout( done, 500 ); }); // wait for es to bring some shards up
131
131
 
@@ -146,7 +146,7 @@ module.exports.tests.stop_words = function(test, common){
146
146
  module.exports.tests.functional = function(test, common){
147
147
  test( 'functional', function(t){
148
148
 
149
- var suite = new elastictest.Suite( common.clientOpts, common.create );
149
+ var suite = new Suite( common.clientOpts, common.create );
150
150
  var assertAnalysis = common.analyze.bind( null, suite, t, 'peliasIndexOneEdgeGram' );
151
151
  suite.action( function( done ){ setTimeout( done, 500 ); }); // wait for es to bring some shards up
152
152
 
@@ -172,7 +172,7 @@ module.exports.tests.functional = function(test, common){
172
172
  module.exports.tests.unique = function(test, common){
173
173
  test( 'unique', function(t){
174
174
 
175
- var suite = new elastictest.Suite( common.clientOpts, common.create );
175
+ var suite = new Suite( common.clientOpts, common.create );
176
176
  var assertAnalysis = common.analyze.bind( null, suite, t, 'peliasIndexOneEdgeGram' );
177
177
  suite.action( function( done ){ setTimeout( done, 500 ); }); // wait for es to bring some shards up
178
178
 
@@ -186,7 +186,7 @@ module.exports.tests.unique = function(test, common){
186
186
  module.exports.tests.address = function(test, common){
187
187
  test( 'address', function(t){
188
188
 
189
- var suite = new elastictest.Suite( common.clientOpts, common.create );
189
+ var suite = new Suite( common.clientOpts, common.create );
190
190
  var assertAnalysis = common.analyze.bind( null, suite, t, 'peliasIndexOneEdgeGram' );
191
191
  suite.action( function( done ){ setTimeout( done, 500 ); }); // wait for es to bring some shards up
192
192
 
@@ -218,7 +218,7 @@ module.exports.tests.address = function(test, common){
218
218
  module.exports.tests.unicode = function(test, common){
219
219
  test( 'normalization', function(t){
220
220
 
221
- var suite = new elastictest.Suite( common.clientOpts, common.create );
221
+ var suite = new Suite( common.clientOpts, common.create );
222
222
  var assertAnalysis = common.analyze.bind( null, suite, t, 'peliasIndexOneEdgeGram' );
223
223
  suite.action( function( done ){ setTimeout( done, 500 ); }); // wait for es to bring some shards up
224
224
 
@@ -1,6 +1,6 @@
1
1
  // validate analyzer is behaving as expected
2
2
 
3
- const elastictest = require('elastictest');
3
+ const Suite = require('../test/elastictest/Suite');
4
4
  const punctuation = require('../punctuation');
5
5
  const config = require('pelias-config').generate();
6
6
  const getTotalHits = require('./_hits_total_helper');
@@ -10,7 +10,7 @@ module.exports.tests = {};
10
10
  module.exports.tests.analyze = function(test, common){
11
11
  test( 'analyze', function(t){
12
12
 
13
- var suite = new elastictest.Suite( common.clientOpts, common.create );
13
+ var suite = new Suite( common.clientOpts, common.create );
14
14
  var assertAnalysis = common.analyze.bind( null, suite, t, 'peliasPhrase' );
15
15
  suite.action( function( done ){ setTimeout( done, 500 ); }); // wait for es to bring some shards up
16
16
 
@@ -62,7 +62,7 @@ module.exports.tests.analyze = function(test, common){
62
62
  module.exports.tests.functional = function(test, common){
63
63
  test( 'functional', function(t){
64
64
 
65
- var suite = new elastictest.Suite( common.clientOpts, common.create );
65
+ var suite = new Suite( common.clientOpts, common.create );
66
66
  var assertAnalysis = common.analyze.bind( null, suite, t, 'peliasPhrase' );
67
67
  suite.action( function( done ){ setTimeout( done, 500 ); }); // wait for es to bring some shards up
68
68
 
@@ -109,7 +109,7 @@ module.exports.tests.functional = function(test, common){
109
109
  module.exports.tests.tokenizer = function(test, common){
110
110
  test( 'tokenizer', function(t){
111
111
 
112
- var suite = new elastictest.Suite( common.clientOpts, common.create );
112
+ var suite = new Suite( common.clientOpts, common.create );
113
113
  var assertAnalysis = common.analyze.bind( null, suite, t, 'peliasPhrase' );
114
114
  suite.action( function( done ){ setTimeout( done, 500 ); }); // wait for es to bring some shards up
115
115
 
@@ -135,7 +135,7 @@ module.exports.tests.tokenizer = function(test, common){
135
135
  module.exports.tests.slop = function(test, common){
136
136
  test( 'slop', function(t){
137
137
 
138
- var suite = new elastictest.Suite( common.clientOpts, common.create );
138
+ var suite = new Suite( common.clientOpts, common.create );
139
139
  var assertAnalysis = common.analyze.bind( null, suite, t, 'peliasPhrase' );
140
140
  suite.action( function( done ){ setTimeout( done, 500 ); }); // wait for es to bring some shards up
141
141
 
@@ -153,7 +153,7 @@ module.exports.tests.slop = function(test, common){
153
153
  module.exports.tests.slop_query = function(test, common){
154
154
  test( 'slop query', function(t){
155
155
 
156
- var suite = new elastictest.Suite( common.clientOpts, common.create );
156
+ var suite = new Suite( common.clientOpts, common.create );
157
157
  var assertAnalysis = common.analyze.bind( null, suite, t, 'peliasPhrase' );
158
158
  suite.action( function( done ){ setTimeout( done, 500 ); }); // wait for es to bring some shards up
159
159
 
@@ -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 );
@@ -249,14 +246,13 @@ module.exports.tests.slop_query = function(test, common){
249
246
  module.exports.tests.slop = function(test, common){
250
247
  test( 'slop', function(t){
251
248
 
252
- var suite = new elastictest.Suite( common.clientOpts, common.create );
249
+ var suite = new Suite( common.clientOpts, common.create );
253
250
  suite.action( function( done ){ setTimeout( done, 500 ); }); // wait for es to bring some shards up
254
251
 
255
252
  // index a document
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': {
@@ -293,7 +288,7 @@ module.exports.tests.slop = function(test, common){
293
288
  module.exports.tests.unicode = function(test, common){
294
289
  test( 'normalization', function(t){
295
290
 
296
- var suite = new elastictest.Suite( common.clientOpts, common.create );
291
+ var suite = new Suite( common.clientOpts, common.create );
297
292
  var assertAnalysis = common.analyze.bind( null, suite, t, 'peliasPhrase' );
298
293
  suite.action( function( done ){ setTimeout( done, 500 ); }); // wait for es to bring some shards up
299
294
 
@@ -1,7 +1,7 @@
1
1
  // validate analyzer is behaving as expected
2
2
 
3
3
  var tape = require('tape'),
4
- elastictest = require('elastictest'),
4
+ Suite = require('../test/elastictest/Suite'),
5
5
  punctuation = require('../punctuation');
6
6
 
7
7
  module.exports.tests = {};
@@ -9,7 +9,7 @@ module.exports.tests = {};
9
9
  module.exports.tests.analyze = function(test, common){
10
10
  test( 'analyze', function(t){
11
11
 
12
- var suite = new elastictest.Suite( common.clientOpts, common.create );
12
+ var suite = new Suite( common.clientOpts, common.create );
13
13
  var assertAnalysis = common.analyze.bind( null, suite, t, 'peliasQuery' );
14
14
  suite.action( function( done ){ setTimeout( done, 500 ); }); // wait for es to bring some shards up
15
15
 
@@ -41,7 +41,7 @@ module.exports.tests.analyze = function(test, common){
41
41
  module.exports.tests.functional = function(test, common){
42
42
  test( 'functional', function(t){
43
43
 
44
- var suite = new elastictest.Suite( common.clientOpts, common.create );
44
+ var suite = new Suite( common.clientOpts, common.create );
45
45
  var assertAnalysis = common.analyze.bind( null, suite, t, 'peliasQuery' );
46
46
  suite.action( function( done ){ setTimeout( done, 500 ); }); // wait for es to bring some shards up
47
47
 
@@ -56,7 +56,7 @@ module.exports.tests.functional = function(test, common){
56
56
  module.exports.tests.address = function(test, common){
57
57
  test( 'address', function(t){
58
58
 
59
- var suite = new elastictest.Suite( common.clientOpts, common.create );
59
+ var suite = new Suite( common.clientOpts, common.create );
60
60
  var assertAnalysis = common.analyze.bind( null, suite, t, 'peliasQuery' );
61
61
  suite.action( function( done ){ setTimeout( done, 500 ); }); // wait for es to bring some shards up
62
62
 
@@ -80,7 +80,7 @@ module.exports.tests.address = function(test, common){
80
80
  module.exports.tests.unicode = function(test, common){
81
81
  test( 'normalization', function(t){
82
82
 
83
- var suite = new elastictest.Suite( common.clientOpts, common.create );
83
+ var suite = new Suite( common.clientOpts, common.create );
84
84
  var assertAnalysis = common.analyze.bind( null, suite, t, 'peliasQuery' );
85
85
  suite.action( function( done ){ setTimeout( done, 500 ); }); // wait for es to bring some shards up
86
86