Skip to content

Commit

Permalink
feat(version): remove _type
Browse files Browse the repository at this point in the history
  • Loading branch information
missinglink committed Mar 13, 2024
1 parent 83b64de commit 79b1607
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 10 deletions.
4 changes: 0 additions & 4 deletions Document.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,6 @@ Document.prototype.toESDocument = function() {
return {
_index: _.get(config, 'schema.indexName', 'pelias'),
_id: this.getGid(),
// In ES7, the only allowed document type will be `_doc`.
// However underscores are not allowed until ES6, so use `doc` for now
// see https://github.com/elastic/elasticsearch/pull/27816
_type: _.get(config, 'schema.typeName', 'doc'),
data: doc
};
};
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"dependencies": {
"lodash": "^4.6.1",
"pelias-config": "^4.5.0",
"pelias-config": "^6.0.0",
"through2": "^3.0.0"
},
"devDependencies": {
Expand Down
6 changes: 1 addition & 5 deletions test/document/toESDocument.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ const codec = require('../../codec');

var fakeGeneratedConfig = {
schema: {
indexName: 'example_index',
typeName: 'example_type'
indexName: 'example_index'
}
};

Expand Down Expand Up @@ -50,7 +49,6 @@ module.exports.tests.toESDocument = function(test) {

var expected = {
_index: 'example_index',
_type: 'example_type',
_id: 'mysource:mylayer:myid',
data: {
layer: 'mylayer',
Expand Down Expand Up @@ -102,7 +100,6 @@ module.exports.tests.toESDocument = function(test) {

var expected = {
_index: 'example_index',
_type: 'example_type',
_id: 'mysource:mylayer:myid',
data: {
source: 'mysource',
Expand Down Expand Up @@ -156,7 +153,6 @@ module.exports.tests.toESDocument = function(test) {

var expected = {
_index: 'example_index',
_type: 'example_type',
_id: 'mysource:mylayer:myid',
data: {
source: 'mysource',
Expand Down

0 comments on commit 79b1607

Please sign in to comment.