Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rafaltrojanowski/a669f23721d0c4a2648220ff458be17a to your computer and use it in GitHub Desktop.
Save rafaltrojanowski/a669f23721d0c4a2648220ff458be17a to your computer and use it in GitHub Desktop.
Local fix of type:
index = "answers"
{:ok, response} = Domain.Env.get(:elasticsearch_url) |> URI.merge("/#{index}/_mapping?pretty") |> URI.to_string() |> Elastix.HTTP.get()
body = response.body
Map.keys(body["answers"]["mappings"]["properties"]["label_ids_with_keywords"]["properties"]) |> Enum.count
@rafaltrojanowski
Copy link
Author

can use Elastic API to to most of the operations, but not sure if all are supported thought (I'd like to get all indexes to check those for a specific organizations) like this:

curl -X GET "localhost:9200/_cat/indices/*?v&s=index&pretty"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment