Actually I'm working with bunch of data represented by the following mapping:
"users" : {
"properties" : {
"__v" : {
"type" : "long"
},
"avatarRelativeURL" : {
"type" : "string"
},
"company" : {
"type" : "string"
},
"date" : {
"type" : "date",
"format" : "dateOptionalTime"
},
"email" : {
"type" : "string"
},
"emailToken" : {
"type" : "string"
},
"emailVerified" : {
"type" : "boolean"
},
"hash" : {
"type" : "string"
},
"managerEmail" : {
"type" : "string"
},
"profile" : {
"properties" : {
"firstname" : {
"type" : "string"
},
"lastname" : {
"type" : "string"
}
}
},
"resume" : {
"properties" : {
"educations" : {
"properties" : {
"annee" : {
"type" : "string"
},
"name" : {
"type" : "string"
},
"school" : {
"type" : "string"
}
}
},
"experiences" : {
"properties" : {
"company" : {
"type" : "string"
},
"endingDate" : {
"type" : "date",
"format" : "dateOptionalTime"
},
"startingDate" : {
"type" : "date",
"format" : "dateOptionalTime"
},
"title" : {
"type" : "string"
}
}
},
"skills" : {
"properties" : {
"category" : {
"type" : "string"
},
"displayedName" : {
"type" : "string"
},
"score" : {
"type" : "long"
}
}
}
}
},
"salt" : {
"type" : "string"
}
}
},
I'm trying to make a query to get the number of skills (in resume.skills.displayedName) the most present.
At this point I succed using this query
localhost:9200/index/users/_search?search_type=count -d 'query = {
'aggs': {
'skills': {
'terms': {
'field': 'resume.skills.displayedName',
'size': 100
}
}
}
}'
This send me the key skills with the counting but my goal at this point is to have a query that would give me the same result + the skill category associated.
In fact, I got my "skills" with 3 field, displayedName, category, score.
So I wish to have the most revelents skills displayedName with the associated category
As an exemple I wanna have :
key: "Shell", "Technical skills", "doc_count": 501
Hope I've been understandable
Thank you very much !
Cheers,