i have already have a ajax jquery code to fetch the cust id in my code and that works fine but while i choose action i doesn't instead it fetch all action for the selected cust id
What I have tried:
This works fine
$.ajax({
type: 'GET',
url: '@Url.Action("GetReport", "Report")',
dataType: 'json',
data: { id: $("#ddl_Custid").val() },
success: function (datas, status) {
var duplicate = [];
$("#ddl_Custid").append('<option value="-1">' + "-Select-" + '</option>');
$.each(datas, function (i, data) {
if (duplicate.indexOf(data.fld_cust_id) == -1) {
$("#ddl_Custid").append('<option value="' + data.fld_cust_id + '">' + data.fld_cust_id + '</option>');
duplicate.push(data.fld_cust_id);
}
});
}
});
But this Doesn't
$.ajax({
type: 'GET',
url: '@Url.Action("GetReport", "Report")',
dataType: 'json',
data: { id: $("#ddl_Action").val() },
success: function (datas, status) {
var duplicate = [];
$("#ddl_Action").append('<option value="-1">' + "-Select-" + '</option>');
$.each(datas, function (i, data) {
if (duplicate.indexOf(data.fld_action) == -1) {
$("#ddl_Action").append('<option value="' + data.fld_action + '">' + data.fld_action + '</option>');
duplicate.push(data.fld_action);
}
});
}
});
This the code part
responsedata = Elastic.Search<ProvLog>(s => s
.Index(defaultIndex)
.Size(8000)
.Query(q => q
.DateRange(r => r
.Field(p => p.fld_date)
.GreaterThanOrEquals(fromDate)
.LessThan(toDate)
.TimeZone("+05:30"))
&& q.Match(m => m.Field(f => f.fld_cust_id).Query(fldCustid))
&& q.Match(m => m.Field(f => f.fld_action).Query(fldAction))
)
.Sort(p => p.Descending("fld_date")));
data = (from hits in responsedata.Hits select hits.Source).ToList();