Skip to content

Instantly share code, notes, and snippets.

@mykoweb
Created December 20, 2016 08:01
Show Gist options
  • Save mykoweb/e3e492f7856fe0f6084224c9f0911b9e to your computer and use it in GitHub Desktop.
Save mykoweb/e3e492f7856fe0f6084224c9f0911b9e to your computer and use it in GitHub Desktop.
req_body_for_patient_a = {
routing: 'PatientA',
filter: {
term: { patient_name: 'PatientA' }
}
}
req_body_for_patient_b = {
routing: 'PatientB',
filter: {
term: { patient_name: 'PatientB' }
}
}
raw_put 'patients/_alias/PatientA', req_body_for_patient_a
raw_put 'patients/_alias/PatientB', req_body_for_patient_b
client.indices.exists_alias? name: 'PatientA' # => true
client.indices.exists_alias? name: 'PatientB' # => true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment