cfpb / sheer

A tool for loading arbitrary content into Elasticsearch and serving that content on the web.
Creative Commons Zero v1.0 Universal
29 stars 23 forks source link

Blend using queries #61

Closed dpford closed 10 years ago

dpford commented 10 years ago

Previously, blends were adding elevated posts to the desired index, but this was not the best way to do it. Now, the query files allow for passing in ElasticSearch filters so the blend can be handled at the query level.

Your query files should now follow this convention:

{
  "name": "Verbose Name",
  "query": {
    "size": 10,
    "sort": "date:desc"
  },
  "filters": [
    {
      "example": "filter"
    }
  ]
}

Also, the Query methods search() and search_with_url_arguments() have been combined into one method due to the amount of overlapping code. Tests were updated as well.

Scotchester commented 10 years ago

@rosskarchner Does this approach seem sound to you?

rosskarchner commented 10 years ago

Yeah, it's a big improvement. Thanks, Dan!