# Migrate from NEST to new Elastic.Clients.Elasticsearch

**URL:** https://discuss.elastic.co/t/migrate-from-nest-to-new-elastic-clients-elasticsearch/361526
**Category:** Elasticsearch
**Tags:** language-clients
**Created:** [June 14, 2024, 8:40pm UTC](https://discuss.elastic.co/t/migrate-from-nest-to-new-elastic-clients-elasticsearch/361526 "2024-06-14T20:40:47Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![krishnapss](https://avatars.discourse-cdn.com/v4/letter/k/43a26b/32.png) [@krishnapss](https://discuss.elastic.co/u/krishnapss)
#### Post date: [June 14, 2024, 8:40pm UTC](https://discuss.elastic.co/t/migrate-from-nest-to-new-elastic-clients-elasticsearch/361526/1 "2024-06-14T20:40:47Z")

</div>

Hi,  
As the NEST nugget package is deprecated, we are trying to migrate new Elastic.Clients.Elasticsearch. I couldn't find much documentation on the new Elastic.Clients.Elasticsearch. NEST has very detailed examples and we were able to so much functionality. But It's really hard to migrate without any help or official documentation or examples.

Could some one please help us.

Is there any alternative to AutoMap?  
And how to use Multi fields?

How to create custom property visitor? Previously when using NEST there is class NoopPropertyVisitor.

What should we use now? Below is an example?

```auto
public class AddNormalizeFieldPropertyVisitor : NoopPropertyVisitor
{
    public override void Visit(
        ITextProperty type,
        PropertyInfo propertyInfo,
        ElasticsearchPropertyAttributeBase attribute)
    {
        if (!type.Fields.ContainsKey(SearchConstants.KeywordNormalizerField))
        {
            type.Fields.Add(SearchConstants.KeywordNormalizerField, new KeywordProperty() { Normalizer = SearchConstants.NormalizerName });
        }
    }
}

```

How to swap aliases?

```auto

 public async Task SwapAlias(string currentIndexName)
 {
     var liveIndexName = _configuration.Value.IndexName;
     var existingIndices = await _elasticSearchClient.GetIndicesPointingToAliasAsync(liveIndexName);

     await _elasticSearchClient.Indices.BulkAliasAsync(aliases =>
     {
         return aliases
             .Remove(a => a.Alias(liveIndexName).Index("*"))
             .Add(a => a.Alias(liveIndexName).Index(currentIndexName));
     });

     if (existingIndices != null)
     {
         foreach (var oldIndex in existingIndices)
         {
             await _elasticSearchClient.Indices.DeleteAsync(oldIndex);
         }
     }
 }

```

Are there any documentation or examples how to use SearchRequest please?

Could some one please help us.

Thank you,  
Krishna
