-
-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(flatten_graph): add flatten_graph filter to ensure multi-word to…
…kens dont produce errors during indexing
- Loading branch information
1 parent
2afa1e3
commit 39afc56
Showing
5 changed files
with
74 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// validate analyzer is behaving as expected | ||
|
||
const elastictest = require('elastictest'); | ||
const schema = require('../schema'); | ||
|
||
module.exports.tests = {}; | ||
|
||
// simple test to cover the issue noted in: | ||
// https://github.com/pelias/schema/issues/381#issuecomment-548305594 | ||
module.exports.tests.functional = function (test, common) { | ||
test('functional', function (t) { | ||
|
||
var suite = new elastictest.Suite(common.clientOpts, { schema: schema }); | ||
suite.action(function (done) { setTimeout(done, 500); }); // wait for es to bring some shards up | ||
|
||
// index a document with all admin values | ||
// note: this will return an error if multi-token synonyms are | ||
// not supported on ES6+ | ||
suite.action(function (done) { | ||
suite.client.index({ | ||
index: suite.props.index, type: 'doc', | ||
id: '1', body: { | ||
name: { default: 'set' }, | ||
phrase: { default: 'set' }, | ||
address_parts: { | ||
name: 'set', | ||
street: 'set' | ||
}, | ||
parent: { | ||
country: 'set' | ||
} | ||
} | ||
}, done); | ||
}); | ||
|
||
suite.run(t.end); | ||
}); | ||
}; | ||
|
||
module.exports.all = function (tape, common) { | ||
|
||
function test(name, testFunction) { | ||
return tape('multi token synonyms: ' + name, testFunction); | ||
} | ||
|
||
for (var testCase in module.exports.tests) { | ||
module.exports.tests[testCase](test, common); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters