Skip to content

Useful ES queries

Kalyan Dutia edited this page Aug 6, 2020 · 1 revision

get all documents

GET heritageconnector/_search
{
  "query": {
    "match_all": {}
  }
}

get all documents which contain a value in a specific field

Field helpfully autocompletes if you start typing.

GET heritageconnector/_search
{
  "query": {
    "query_string": {
      "default_field": "doc.graph.@foaf:[email protected]",
      "query": "*"
    }
  }
}

text search

search certain fields only

GET wikidump_humans/_search
{
  "query": {
    "multi_match" : {
      "query": "john lennon", 
      "fields": [ "labels", "aliases" ] 
    }
  }
}