Skip to content

Commit

Permalink
Merge pull request #6463 from spalger/fix/useOfIgnUnmapped
Browse files Browse the repository at this point in the history
[es/kibanaIndex] use unmapped_type rather than ignore_unmapped
  • Loading branch information
Rashid Khan committed Mar 8, 2016
2 parents d9b1b30 + af5ab8a commit 96b4519
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 13 deletions.
13 changes: 3 additions & 10 deletions src/plugins/elasticsearch/lib/create_kibana_index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import SetupError from './setup_error';
import { format } from 'util';
import { mappings } from './kibana_index_mappings';

module.exports = function (server) {
const client = server.plugins.elasticsearch.client;
const index = server.config().get('kibana.index');
Expand All @@ -16,16 +18,7 @@ module.exports = function (server) {
settings: {
number_of_shards: 1
},
mappings: {
config: {
properties: {
buildNum: {
type: 'string',
index: 'not_analyzed'
}
}
}
}
mappings
}
})
.catch(handleError('Unable to create Kibana index "<%= kibana.index %>"'))
Expand Down
10 changes: 10 additions & 0 deletions src/plugins/elasticsearch/lib/kibana_index_mappings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export const mappings = {
config: {
properties: {
buildNum: {
type: 'string',
index: 'not_analyzed'
}
}
}
};
12 changes: 9 additions & 3 deletions src/plugins/elasticsearch/lib/migrate_config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import upgrade from './upgrade_config';
import { mappings } from './kibana_index_mappings';

module.exports = function (server) {
const config = server.config();
Expand All @@ -8,11 +9,16 @@ module.exports = function (server) {
type: 'config',
body: {
size: 1000,
sort: [ { buildNum: { order: 'desc', ignore_unmapped: true } } ]
sort: [
{
buildNum: {
order: 'desc',
unmapped_type: mappings.config.properties.buildNum.type
}
}
]
}
};

return client.search(options).then(upgrade(server));
};


0 comments on commit 96b4519

Please sign in to comment.