Skip to content

Instantly share code, notes, and snippets.

@nithinkashyapn
Last active December 28, 2018 11:52
Show Gist options
  • Select an option

  • Save nithinkashyapn/82a2b5c1234dc9185df90fd93e68cc79 to your computer and use it in GitHub Desktop.

Select an option

Save nithinkashyapn/82a2b5c1234dc9185df90fd93e68cc79 to your computer and use it in GitHub Desktop.
ES Queries
All candidates sourced today by everyone
Count of candidatesources/_count
{
"query": {
"range":{
"candidateCreationTime":{
"gte": "28/12/2018",
"format": "dd/MM/yyyy"
}
}
}
}
Count of candidates sourced last month by everyone
GET candidatesources/_count
{
"query": {
"range":{
"candidateCreationTime":{
"gte": "01/12/2018",
"format": "dd/MM/yyyy"
}
}
}
}
Count of candidates sourced last month by one person
GET candidatesources/_count
{
"query": {
"bool" : {
"must" :{
"range":{
"candidateCreationTime":{
"gte": "01/12/2018",
"format": "dd/MM/yyyy"
}
}
},
"filter": {
"term" : { "candidateSourcedBy" : "5c01284a3b433b4bb11cb36c" }
}
}
}
}
Count of candidates sourced last month by everyone
GET candidatesources/_count
{
"query": {
"bool" : {
"must" :{
"range":{
"candidateCreationTime":{
"gte": "01/12/2018",
"format": "dd/MM/yyyy"
}
}
},
"filter": {
"term" : { "cadidateSourcedByCompany" : "5c0127b73b433b4bb11cb364" }
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment