Created
September 28, 2020 16:03
-
-
Save mbklein/2cfa3f29d406fa89ea797c72b389605e to your computer and use it in GitHub Desktop.
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
def recommon | |
query = {"size" => 1000, "query"=>{"bool"=>{"must"=>[{"match"=>{"model.name"=>"FileSet"}}], "must_not"=>{"exists"=>{"field"=>"simple_title"}}}}} | |
result = CommonIndexer.client.search(body: query) | |
while result['hits']['hits'].length > 0 | |
result['hits']['hits'].each do |hit| | |
fs = FileSet.find(hit['_id']) | |
fs.update_common_index | |
$stderr.print('.') | |
end | |
result = CommonIndexer.client.search(body: query) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment