several things are in this commit:
- coarse reverse controller / pip service
- inject "conditional execute" predicate into search service to shortcut execution conditions
- added coarse reverse controller to precede standard reverse controller
- lots of tests!
Timeout errors come back from the Elasticsearch module as Error objects,
so instead of pushing the entire object onto the errors array, we should
just push the message.
I'm not sure if there are other cases where errors are just strings,
errors that aren't objects with a message property are handled as
before.
This middleware looks at the list of types that will be sent to
Elasticsearch, if it's an empty array, it sends an error response before
Elasticsearch is even quieried, because Elasticsearch interprets an
empty type array as "search anything" rather than the intended "don't
search anything".
This moves the list of types created by sanitising the layer API
parameter from clean.layers to clean.types.from_layers. In subsequent
commits, types created from address parsing, and the
yet-to-be-implemented source parameter will also live in the clean.types
object.
This will allow moving logic to set cmd.type out of controllers, and
into separate logic that can be a littler smarter. Also, it will no
longer require the clean.default_layers_set flag to be passed all around
like a nasty global variable.
This middleware looks at the list of types that will be sent to
Elasticsearch, if it's an empty array, it sends an error response before
Elasticsearch is even quieried, because Elasticsearch interprets an
empty type array as "search anything" rather than the intended "don't
search anything".