i am using nest version 7.17 in .net core and completion suggester this is my code below
[HttpGet("[action]")]
public async Task<IActionResult> AutoComplete(string query)
{
var result1 = _elasticClient.Search<Product>(p => p
.Index(nameof(Product).ToLowerInvariant())
.Suggest(ss => ss
.Completion("my-term-suggest", t => t
.Field(p => p.Title)
.Prefix(query)
.Fuzzy(f => f.Fuzziness(Fuzziness.Auto))
)
)
);
//return Ok(result1.Suggest["my-term-suggest"].ToList());
return Ok(result1.Documents.ToList());
}
and this is index model
public class Product
{
public int Id { get; set; }
[Completion]
public string Title { get; set; }
public string Description { get; set; }
public int Price { get; set; }
public int Quantity { get; set; }
}
after executing the AutoComplete Action i cant see any result could any one tell what am i mistake? any help will be highly appreciated