elastix icon indicating copy to clipboard operation
elastix copied to clipboard

API to update Settings

Open thiagogsr opened this issue 6 years ago • 1 comments

Hey

Is there a API to update the index settings or to setup it together the mapping using Elastix?

thiagogsr avatar May 29 '18 15:05 thiagogsr

That could be achieved with the next code:

index_config = %{
  settings: %{
    analysis: %{
      analyzer: %{
        email_field: %{
          type: "custom",
          tokenizer: "uax_url_email",
          filter: ["lowercase", "stop"]
        }
      }
    }
  },
  mappings: %{
    properties: %{
      id: %{type: "text", fielddata: true},
      originator_email: %{type: "text", analyzer: "email_field"},
    }
  }
}

Elastix.Index.create("http://localhost:9200", "my-index", index_config)

retgoat avatar Feb 24 '21 04:02 retgoat