mooreniemi / Transbucket_Rails

:hospital: → :camera: → :thumbsup:
http://www.transbucket.com
10 stars 4 forks source link

SearchSchema - clean up for aggs, default to updated_at #101

Closed mooreniemi closed 3 years ago

mooreniemi commented 3 years ago

Will need to reindex using:

rake environment elasticsearch:import:all FORCE=y

Some queries we'll be able to do after:

GET development_pins/_search?size=0
{
  "query": {
    "terms": { "surgeon.pretty_name.keyword": [ "Abrikosovsky, Ruben" ] }
  },
  "aggregations": {
    "significant_x": {
      "significant_terms": { "field": "complications.name.keyword" }
    }
  }
}

GET development_pins/_search
{
  "query": {
    "match": {
      "complications.name": "stuffs"
    }
  }
}

GET development_pins/_search?size=0
{
  "aggs": {
    "test": {
      "terms": { "field": "complications.name.keyword" } 
    }
  }
}