Skip to content

Instantly share code, notes, and snippets.

@barrucadu
Created February 28, 2019 12:58
Show Gist options
  • Select an option

  • Save barrucadu/bc0ef27e41656d2c12a161bd049c92e6 to your computer and use it in GitHub Desktop.

Select an option

Save barrucadu/bc0ef27e41656d2c12a161bd049c92e6 to your computer and use it in GitHub Desktop.
for index in page-traffic metasearch govuk government detailed; do
for doctype in aaib_report asylum_support_decision best_bet business_finance_support_scheme \
cma_case contact countryside_stewardship_grant dfid_research_output drug_safety_update \
edition employment_appeal_tribunal_decision employment_tribunal_decision \
european_structural_investment_fund export_health_certificate hmrc_manual \
hmrc_manual_section international_development_fund maib_report manual manual_section \
medical_safety_alert page-traffic policy raib_report residential_property_tribunal_decision \
service_manual_guide service_manual_topic service_standard_report tax_tribunal_decision \
utaac_decision statutory_instrument; do
es2_count=`curl http://localhost:9200/$index/$doctype/_count 2>/dev/null | jq .count`
es5_count=`curl "http://elasticsearch5/$index/generic-document/_count?q=document_type:$doctype" 2>/dev/null | jq .count`
if [[ "$es2_count" != "$es5_count" ]]; then
echo "$index : $doctype"
echo " es2: $es2_count"
echo " es5: $es5_count"
echo
fi
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment