Skip to content

Git Queries

List unique email domains of users

GET /git-commits-*/_search
{
  "aggs": {
    "topics": {
        "terms": {
            "field": "authorEmailDomain",
            "size": 100
        }
    }
  },
  "size" : 0 
}

List unique email domains of users

GET /git-commits-*/_search
{
  "aggs": {
    "topics": {
        "terms": {
            "field": "authorEmail",
            "size": 100
        }
    }
  },
  "size" : 0 
}

List unique names of users, with the number of commits

GET /git-commits-*/_search
{
  "aggs": {
    "topics": {
        "terms": {
            "field": "authorName",
            "size": 100
        }
    }
  },
  "size" : 0 
}

List commits from specific name

GET /git-commits-*/_search
{
  "query": {
    "bool": {
      "must": [
          { "match": {
              "authorName": {"query": "cazala"}
              }
          }
      ]
    }
  }
}

List commits by size of commit message

GET /git-commits-*/_search
{
  "sort" : [
      {"messageWordCount" : {"order" : "desc", "mode" : "avg"}}
  ],
  "size" : 100
}

List commits by most lines inserted

GET /git-commits-*/_search
{
  "sort" : [
      {"totalInsertions" : {"order" : "desc", "mode" : "avg"}}
  ],
  "size" : 100
}