Commit 38ce1390 authored by Jason Colyer's avatar Jason Colyer Committed by Dmitriy Zaporozhets

Update documentation and add new Rake task:

- Added yum command for libicu-devel install
- Added `git clone` and cd commands to install instructions
- Added note about system requirements
- Added optional step to delete the index for disabling ElasticSearch
- Removed step about creating empty index, as wrapper script does this
- Added warning about async indexing and sidekiq
- Added section about rake tasks
  - Defined rake tasks and linked to corresponding rake file
- Added periods to the end of rake task descriptions
- Added Scopes section
- Added Environment Variables Section
  - Added subsection about batching
  - Added subsection about indexing one project
- Added more to troubleshooting not finding data
- Added more to troubleshooting concerning time it takes to index
- Added troubleshooting section verifying ElasticSearch is being used
- Fixed typo in indexing small instances section
  - use the index the data ~>  index the data
- Added hyperlink to the Enabling ElasticSearch section
- Removed unneeded comma from line 33
- Put emphasis on MUST on line 173
- Changed some wording on line 187
  - time drop -> decreae in indexing time
- Fixed spelling and grammar mistakes
- Added example of using BATCH
- Fixed typo on line 67: TO ~> To
- Removed `the` on line 442
- Wrapped scope names in backtickets on lines 428-436
- Changed `user` to `GitLab instance` on line 402
- Specfied default 300 projects instead of just 300 on line 384 and 392
- Removed line numbers from links, lines 332-376
- Changed * to - for listing style, lines 332-376
- Changed * to - for listing style, lines 397-400
- Added backticks to variable names, lines 384-387
- Removed a `#` from Batching for spacing niceness, line 389
- Removed a `#` from Indexing a specific... for spacing niceness, 412
- Added periods for full stops on env variable table, lines 384-387
- Changed pipe symbol to slash for table formatting on L385
- Changed all instances of ElasticSearch to Elasticsearch
- Changed Project.all to ActiveRecord query
- Used count on ActiveRecord query to determine if all were indexed
- Used find_each to process in batches for efficiency
- Changed ActiveRecord query to make it cleaner
- Removed spec test for new rake task as it was unneeded
- Remade projects_not_indexed task to show 1st 500 nonindexed projects
  - Added ability to display all using env variable SHOW_ALL
- Put a newline before `if not_indexed`
- Put a newline between `end` and `arr`
- Put a newline between `end` and `puts`
- Fixed spacing issues
- Used return of conditional for vairable assignment on L224
- Added README.md to high_availability link
parent 02c63702
This diff is collapsed.
---
title: Added gitlab:elastic:projects_not_indexed rake task
merge_request: 9854
author: Jason Colyer
type: added
......@@ -179,6 +179,17 @@ namespace :gitlab do
puts "Done".color(:green)
end
desc "GitLab | Elasticsearch | Display which projects are not indexed"
task projects_not_indexed: :environment do
not_indexed = Project.where.not(id: IndexStatus.select(:project_id).distinct)
if not_indexed.count.zero?
puts 'All projects are currently indexed'.color(:green)
else
display_unindexed(not_indexed)
end
end
def batch_size
ENV.fetch('BATCH', 300).to_i
end
......@@ -208,5 +219,19 @@ namespace :gitlab do
projects
end
def display_unindexed(projects)
arr = if projects.count < 500 || ENV['SHOW_ALL']
projects
else
projects[1..500]
end
arr.each do |p|
puts "Project '#{p.full_path}' (ID: #{p.id}) isn't indexed.".color(:red)
end
puts "#{arr.count} out of #{projects.count} non-indexed projects shown."
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment