I'm pretty new to Elastic Search / NEST and need some help with how to be able to query/filter my data.
I am trying to retire data from Elastic Search using NEST. Even though I am getting the correct count of data it has not mapped to the model class correctly. Could someone help me to identify what makes went wrong this?
This is what I am getting on Elastic Search:
This is what am getting on NEST.
Code - function
public async Task<List<WebstoreOperationLogModel>> GetAllWebStoreLogs(int WebStoreId)
{
var response = await elasticClient.SearchAsync<WebstoreLogModel>(s => s
.Index("webstore-logs")
.Query(q => q.Term("WebstoreId",
WebStoreId.ToString())));
var logList = response.Documents.ToList();
return mapper.Map<List<WebstoreOperationLogModel>>(logList);
}
Model Class
public class WebstoreLogModel
{
public Guid WebstoreLogId { get; set; }
public int WebstoreId { get; set; }
public string LogMessage { get; set; }
public int LogType { get; set; }
public bool IsExceptionOccurred { get; set; }
public DateTime LogDateTime { get; set; }
}