- Change the specs and the queries to move
filters
fromfilter
toquery.filtered.filter
- Move
{term: {budget_lea_id: budget_lea_id}
from query toquery.filtered.filter
- Create PayloadBuilder library to build payloads
- Convert JBuilder code to PayloadBuilder library
- Move authorization from AR to ES.*
- Move ordering from PG to ES
- Remove
results.records
** - Move pagination from PG to ES
Footnotes
*Originally, I thought we could just use a Ruby function which rejects items in the results set. For pagination (as a filter could change the pagination), better to do in ES
** Due to the fact we call
results.records
and then use Postgres to filter, we can't use ElasticSearch for pagination until we removeresults.records
.
I like it. Looks good. Didn't see any use of the boolean OR operator on filters. Also, may want to use 'multi-match' and 'query' instead of 'fuzzy_like_this' (https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-flt-query.html)