# Could not cast or convert from System.String to Nest.CompletionField

**URL:** <https://discuss.elastic.co/t/could-not-cast-or-convert-from-system-string-to-nest-completionfield/169304>\
**Category:** Elasticsearch\
**Created:** [February 20, 2019, 11:22pm UTC](https://discuss.elastic.co/t/could-not-cast-or-convert-from-system-string-to-nest-completionfield/169304 "2019-02-20T23:22:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![elastic\_man](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elastic_man/32/41171_2.png) [@elastic\_man](https://discuss.elastic.co/u/elastic_man)\
**Post date:** [February 20, 2019, 11:22pm UTC](https://discuss.elastic.co/t/could-not-cast-or-convert-from-system-string-to-nest-completionfield/169304/1 "2019-02-20T23:22:38Z")

</div>

**_[Elasticsearch.Net](http://Elasticsearch.Net) and Nest 6.4.2_**

I am trying to implement completion suggestor in [ASP.NET](http://ASP.NET).

However, I am getting an exception error

> **Error converting value "200 1/2 E 111TH PL" to type 'Nest.CompletionField'. Path suggest.completion#address-suggest[0].options[0].\_source.street\_addr', line 29, position 50.**

Here is my **controller**

```
var responsedata = _connectionToEs.EsClient().Search<address>(s => s
                                         .Index("address5")               
                                         .Suggest(ss => ss
                                            .Completion("address-suggest", cs => cs
                                                .Field(f => f
                                                    .street_addr)
                                                    .Prefix(phrase)
                                                    .Fuzzy(f => f
                                                        .Fuzziness(Fuzziness.Auto)
                                                    )
                                                    .Size(5)
                                            )
                                         ));

```

Here is my **POCO**

```
   public class address
    {
        public CompletionField street_addr { get; set; }
    }

```

My objective is to do autocomplete for addresses. Can anyone tell me what is wrong?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 20, 2019, 11:22pm UTC](https://discuss.elastic.co/t/could-not-cast-or-convert-from-system-string-to-nest-completionfield/169304/2 "2019-03-20T23:22:40Z")

</div>

Closed on March 20, 2019, 11:22pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
