Common Solr Queries in Elasticsearch Query DSL

Here are some common Solr queries translated into Elastic Search's Query DSL. Hopefully it will assist anyone migrating from Solr to ES.

Basic select, with specific field

http://localhost:8983/solr/select?q=lucene&fl=title
{
    "query": {
        "query_string": {
            "query": "lucene",
            "fields": ["title"]
        }
    }
}

Query fields (qf param)

http://localhost:8983/solr/select?q=lucene&fl=title&qf=title^10+body^2
{
    "query": {
        "query_string": {
            "query": "lucene",
            "fields": ["title^10","body^2"]
        }
    }
}

Filter queries (fq param)

http://localhost:8983/solr/select?q=lucene&fq=name:elastic&fq=name:search
{
  "query": {
    "filtered": {
      "query": {
        "query_string": {
          "query": "lucene"
        }
      },
      "filter": {
        "and": [
          {
            "query": {
              "query_string": {
                "query": "name:elastic"
              }
            }
          },
          {
            "query": {
              "query_string": {
                "query": "name:search"
              }
            }
          }
        ]
      }
    }
  }
}

Facets

http://localhost:8983/solr/select?q=lucene&facet=on&facet.fl=category
{
  "query": {
    "query_string": {
      "query": "lucene"
    }
  },
  "facets": {
    "category": {
      "terms": {
        "field": "category",
        "size": 10
      }
    }
  }
}

Geo-Spatial search (within x km of a point)

http://localhost:8983/solr/select?q=*:*&fq={!geofilt pt=45.15,-93.85 sfield=store d=25}
{
  "query": {
    "filtered": {
      "query": {
        "match_all": {}
      },
      "filter": {
        "geo_distance": {
          "distance": "25km",
          "pin.location": {
            "lat": 45.15,
            "lon": -93.85
          }
        }
      }
    }
  }
}