My record is like this:
{
"_index": "cmmtest2",
"id": "q3_WdIgBcz5F0I953TG",
"_score": 1,
"_source": {
"characteristic": "150 W8 Prof 0.1 J",
"actual": 0.019991,
"nominal": 0,
"partno": "2022_7933 S2",
"XBAR": "XX"
}
}
My code is:
public class Record2
{
public string characteristic { get; set; }
public float actual { get; set; }
public float nominal { get; set; }
public string partno { get; set; }
public string XBAR { get; set; }
}
public static string Initial2()
{
var settings = new ConnectionSettings(new Uri("http://localhost:9200")).DefaultIndex("cmmtest2");
settings.DisableDirectStreaming();
var client = new ElasticClient(settings);
var searchResponse = client.Search<Record2>(s=>s.Size(300));
var record = searchResponse.Hits;
return record.ToString();
}
I can get value from "Hits" if the field name is in lower case, but cannot get value in upper case like "XBAR".
In python or other tools, it doesn't matter. Does it have any solution?