mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-01-17 06:52:27 +01:00
spaces stats index in elastic
This commit is contained in:
parent
4a9fb5855f
commit
2419a96010
@ -11,6 +11,7 @@
|
|||||||
- Fix a bug: unable to delete an administrator from the system
|
- Fix a bug: unable to delete an administrator from the system
|
||||||
- [TODO DEPLOY] `rake db:migrate`, then `rake db:seed`
|
- [TODO DEPLOY] `rake db:migrate`, then `rake db:seed`
|
||||||
- [TODO DEPLOY] add the `FABLAB_WITHOUT_SPACES` environment variable
|
- [TODO DEPLOY] add the `FABLAB_WITHOUT_SPACES` environment variable
|
||||||
|
- [TODO DEPLOY] `rake fablab:es_add_spaces`
|
||||||
|
|
||||||
## v2.4.10 2017 January 9
|
## v2.4.10 2017 January 9
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ namespace :fablab do
|
|||||||
puts "PUT index stats"
|
puts "PUT index stats"
|
||||||
`curl -XPUT http://#{ENV["ELASTICSEARCH_HOST"]}:9200/stats`
|
`curl -XPUT http://#{ENV["ELASTICSEARCH_HOST"]}:9200/stats`
|
||||||
|
|
||||||
%w[account event machine project subscription training user].each do |stat|
|
%w[account event machine project subscription training user space].each do |stat|
|
||||||
puts "PUT Mapping stats/#{stat}"
|
puts "PUT Mapping stats/#{stat}"
|
||||||
`curl -XPUT http://#{ENV["ELASTICSEARCH_HOST"]}:9200/stats/#{stat}/_mapping -d '
|
`curl -XPUT http://#{ENV["ELASTICSEARCH_HOST"]}:9200/stats/#{stat}/_mapping -d '
|
||||||
{
|
{
|
||||||
@ -96,6 +96,31 @@ namespace :fablab do
|
|||||||
}';`
|
}';`
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
desc 'add spaces reservations to statistics'
|
||||||
|
task es_add_spaces: :environment do
|
||||||
|
`curl -XPUT http://#{ENV["ELASTICSEARCH_HOST"]}:9200/stats/space/_mapping -d '
|
||||||
|
{
|
||||||
|
"properties": {
|
||||||
|
"type": {
|
||||||
|
"type": "string",
|
||||||
|
"index" : "not_analyzed"
|
||||||
|
},
|
||||||
|
"subType": {
|
||||||
|
"type": "string",
|
||||||
|
"index" : "not_analyzed"
|
||||||
|
},
|
||||||
|
"date": {
|
||||||
|
"type": "date"
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"index" : "not_analyzed"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}';`
|
||||||
|
end
|
||||||
|
|
||||||
desc 'sync all/one project in ElasticSearch index'
|
desc 'sync all/one project in ElasticSearch index'
|
||||||
task :es_build_projects_index, [:id] => :environment do |task, args|
|
task :es_build_projects_index, [:id] => :environment do |task, args|
|
||||||
client = Project.__elasticsearch__.client
|
client = Project.__elasticsearch__.client
|
||||||
|
Loading…
x
Reference in New Issue
Block a user