Here is the mapping file, I am using:
{
"settings": {
"number_of_shards": 2
},
"mappings": {
"properties": {
"SensitiveInfoTypeData": {
"type": "nested",
"properties": {
"Id": {
"type": "keyword"
},
"Count": {
"type": "keyword"
},
"Confidence": {
"type": "keyword",
"fields": {
"Raw": {
"type": "long"
}
}
}
}
}
}
}
}
PUT
{
"SensitiveInfoTypeData": [
{
"Id": "Record1_id1",
"confidence": 70,
"confidence1": 70,
"count": 1
},
{
"Id": "Record2_id2",
"confidence": 80,
"confidence1": 80,
"count": 2
}
]
}
Question:
- How do I make a range query on the confidence field which has multi-field "keyword" & "long". This is what I am trying
{
"query": {
"nested": {
"path": "SensitiveInfoTypeData",
"query": {
"range": {
"SensitiveInfoTypeData.confidence": {
"gt": 70,
"lt": 100
}
}
}
}
}
}
which is returning results as expected but I think it is working on the "keyword" and not on the "long" raw field. Could someone help me out with the right Range query here which will work on the Raw field inside confidence?