I want to create a search on "user" index with ASP.NET MVC. DataSearch Action Method:
public JsonResult DataSearch(string name)
{
var responsedata = _connectionToEs.EsClient().Search<User>(s => s
.Index("user")
.Type("doc")
.Size(50)
.Query(q => q
.Match(m => m
.Field(f => f.name)
.Query(name)
)
)
);
var datasend = (from hits in responsedata.Hits
select hits.Source).ToList();
return Json(new { datasend, responsedata.Took }, behavior: JsonRequestBehavior.AllowGet);
}
I got error in .Type("doc"). Severity Code Description Project File Line Suppression State Error CS1061 'SearchDescriptor' does not contain a definition for 'Type' and no accessible extension method 'Type' accepting a first argument of type 'SearchDescriptor' could be found (are you missing a using directive or an assembly reference?). I already added using Elasticsearch.Net; using Nest; using Newtonsoft.Json;. How to fix this problem? Thanks