Can't found the field "Suggest" in Nest

I just define the model as below code

client.Indices.Create("demo", c => c
                   .Index<Company>()
                   .Map<Company>(c => c
                        .AutoMap()
                        .Properties(p => p
                            .Completion(c => c
                                .Name(n => n.Suggest))
                            .Keyword(k => k.Name(x => x.CompanyName))
                            .Nested<Employee>(e => e
                                .Name(nm => nm.Employees)
                                .AutoMap()
                                .Properties(pps => pps
                                    .Completion(c => c
                                        .Name(n => n.Suggest))
                                    .Nested<House>(h => h
                                        .Name(n => n.Houses)
                                        .AutoMap()
                                        )
                                    )
                                )
                            )
                        )
                );

In the result on ElasticSearch I see the field is "Suggest": {
....
}

I define the search (autocomplete) for that.

 var response = await ElasticSearch.Instance._elasticClient.SearchAsync<Company>(q => q
            .Index("demo")
            .Source(so => so
                .Includes(f => f
                    .Field(f => f.CompanyName)
                    .Field(f => f.Id)))
            .Suggest(su => su
                .Completion("suggestion", cs => cs
                    .Field(f => f.Suggest)
                    .Prefix(input.CompanyName)
                    .Fuzzy(f => f
                        .Fuzziness(Fuzziness.Auto))
                    .Size(10)
                    )
                )
            );

I got the errors when it's runing
Can't found the field "Suggest"

I dont understand where is it wrong?

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