Hi @dadoonet ,
Thanks for the response.
GET mr-profiles/_search
{
"query": {
"bool": {
"must": [
{
"nested": {
"path": "resume.profile.locations",
"query": {
"bool": {
"must": [
{
"exists": {
"field": "resume.profile.locations"
}
},
{
"script": {
"script": {
"source": "doc['resume.profile.locations'].size() > 2",
"lang": "painless"
}
}
}
]
}
}
}
}
]
}
}
}```
This the query.. what I performed I got,
{
"error": {
"root_cause": [
{
"type": "script_exception",
"reason": "runtime error",
"script_stack": [
"org.elasticsearch.server@8.8.0/org.elasticsearch.search.lookup.LeafDocLookup.getFactoryForDoc(LeafDocLookup.java:148)",
"org.elasticsearch.server@8.8.0/org.elasticsearch.search.lookup.LeafDocLookup.get(LeafDocLookup.java:191)",
"org.elasticsearch.server@8.8.0/org.elasticsearch.search.lookup.LeafDocLookup.get(LeafDocLookup.java:32)",
"doc['resume.profile.locations'].size() > 2",
" ^---- HERE"
],
"script": "doc['resume.profile.locations'].size() > 2",
"lang": "painless",
"position": {
"offset": 4,
"start": 0,
"end": 42
}
}
],
"type": "search_phase_execution_exception",
"reason": "all shards failed",
"phase": "query",
"grouped": true,
"failed_shards": [
{
"shard": 0,
"index": "mr-profiles",
"node": "9PF_FW5aQcmLIxDothVTOg",
"reason": {
"type": "script_exception",
"reason": "runtime error",
"script_stack": [
"org.elasticsearch.server@8.8.0/org.elasticsearch.search.lookup.LeafDocLookup.getFactoryForDoc(LeafDocLookup.java:148)",
"org.elasticsearch.server@8.8.0/org.elasticsearch.search.lookup.LeafDocLookup.get(LeafDocLookup.java:191)",
"org.elasticsearch.server@8.8.0/org.elasticsearch.search.lookup.LeafDocLookup.get(LeafDocLookup.java:32)",
"doc['resume.profile.locations'].size() > 2",
" ^---- HERE"
],
"script": "doc['resume.profile.locations'].size() > 2",
"lang": "painless",
"position": {
"offset": 4,
"start": 0,
"end": 42
},
"caused_by": {
"type": "illegal_argument_exception",
"reason": "No field found for [resume.profile.locations] in mapping"
}
}
}
]
},
"status": 400
}```
This is Error what i got..
Here, I gave a mapping to that field "resume.profile.locations" but, why it is showing an error