bitemyapp / bloodhound

Haskell Elasticsearch client and query DSL
bitemyapp.com
BSD 3-Clause "New" or "Revised" License
424 stars 118 forks source link

Add support for Search After API #242

Closed shulhi closed 5 years ago

shulhi commented 6 years ago

This adds support for https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-search-after.html

I decided to make the type search_after as [Aeson.Value] because this can be anything based on what user specified in sort body (in Search). SearchAfterKey is just type synonym to [Aeson.Value].

Please let me know if this is okay. We are actually using this in production soon at Plow and it would be great if this PR can be merged so we can use the upstream version instead of our forked version.

shulhi commented 6 years ago

@bitemyapp it looks like the tests are failing for v1 with GHC8.0. It was roundtrips error for BoolQuery and I am not sure why. That part of code doesn't change and my changes should only affect v5. Search after API is not supported in V1. I might need some help with this.

MichaelXavier commented 6 years ago

I kicked the test to run again. These roundtrip tests occasionally fail and I think they probably do with some better shrinking since in this case the repro query was massive. Nevertheless, if it is just a V1 failure and your feature isn't even available on V1, I'd say the failure shouldn't impede merging.

bitemyapp commented 5 years ago

@shulhi Thank you for PR'ing this!