Skip to content

Support analysis aliases #603

Closed
Closed
@micah-bloomerang

Description

@micah-bloomerang

I'm trying to convert an existing code base to Nest, and I'm having trouble with the CreateIndex command. The command I'm trying to convert is this:

{ 
  "index": {
    "analysis": {
      "analyzer": {
        "default": {
          "type": "custom",
          "tokenizer": "uax_url_email",
          "filter": ["standard", "asciifolding", "lowercase", "stop"],
          "alias": ["default_index", "default_search"]
        }
      }
    }
  }
}

I think I want something that looks like:

client.CreateIndex(indexName, c => c
                .Analysis(a => a
                    .Analyzers(a2 => a2
                        .Add("default", new CustomAnalyzer() {
                            Tokenizer = "uax_url_email",
                            Filter = new List<string>() { "standard", "asciifolding", "lowercase", "stop" },
                            Alias = new List<string>() { "default_index", "default_search" }
                        }))));

but Alias isn't available on CustomAnalyzer. What's the best way to pull this off?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions