spring-io/sagan — pull request #421 by bjornerik (2014-06-15 10:02:07+00:00)
Title: Search should not return unpublished entries

There is a passing test for this, `SearchFacetsIntegrationTests#unpublishedEntriesDoNotAppearInResultsOrFacets`, but it was green for the wrong reason (duplicate path).

This commit applies several fixes to how the date `publishAt` is handled in search:

* `publishAt` is set to `date` in the Elasticsearch mapping.
* A date format is provided to the `Gson` instance in the configured Jest client.
* Filter for unpublished entries are moved to a query filter. When applied as a post filter, the unpublished entries are correctly filtered out from the query result, but show up in the facets.

**NOTE:** The search index must obviously be rebuilt if this fix is applied to the live system.