Skip to content

Instantly share code, notes, and snippets.

@blooberr
Created June 11, 2014 19:19
Show Gist options
  • Save blooberr/0ea66f9676a7b987b44a to your computer and use it in GitHub Desktop.
Save blooberr/0ea66f9676a7b987b44a to your computer and use it in GitHub Desktop.
myhost = "localhost"
@es = Elasticsearch::Client.new host: myhost, port: 9200, log: true
@es.create index: "hello",
type: "world",
id: "someitem",
body: {
text: "yup",
count: 1
}
@es.indices.put_alias index: "hello", name: "alias-hello"
@es.search index: "alias-hello"
@es.indices.close index: "alias-hello"
@es.search index: "alias-hello", ignore_unavailable: true ## throws error
@es.search index: "xxxxzzzzwrongindex", ignore_unavailable: true ## doesn't throw error. Expected behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment