Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API to update Settings #51

Open
thiagogsr opened this issue May 29, 2018 · 1 comment
Open

API to update Settings #51

thiagogsr opened this issue May 29, 2018 · 1 comment

Comments

@thiagogsr
Copy link

thiagogsr commented May 29, 2018

Hey

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

@retgoat
Copy link

retgoat commented Feb 24, 2021

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants