spandex icon indicating copy to clipboard operation
spandex copied to clipboard

Implement Search After based on refactored scroll-chan

Open axel-angel opened this issue 6 years ago • 6 comments

We noticed some performance issue because we're solely using ES scroll to retrieve pages of results of our queries for "real-time" requests, however it's strongly discouraged in the doc. Here we opt to implement Search After which is very close to scroll-chan, the difference is the necessity to have a proper ordering through :sort

Note that this PR refactored and simplified scroll-chan plus we fixed a possible bug: we always pick the last scroll, acquired from the last page, which wasn't the case before. As described in the doc, we should always use the lastest scroll.

Other note, We noticed that chan->seq doesn't properly close the chan when the seq isn't entirely consumed. We also simplified it using simple clojure functions. This issue was already here and no idea how to fix it yet :/ Any idea welcomed.

axel-angel avatar Apr 01 '20 09:04 axel-angel

@mpenet Can you take a look and opinion on this?

axel-angel avatar Apr 01 '20 09:04 axel-angel

@mpenet I've revised and made new tests. Can you take a look for merging this? thank you

axel-angel avatar Apr 06 '20 17:04 axel-angel

Hi, I somehow didn't get any notification, I will have a look at it once I have a bit of free time, probably this week-end.

mpenet avatar Apr 07 '20 11:04 mpenet

Hi Max, no problem. Keep me updated or ping me if you need. Thanks.

axel-angel avatar Apr 07 '20 16:04 axel-angel

@mpenet FYI we've been running with this patch in prod since a few days & it's working fine.

rborer avatar Apr 30 '20 13:04 rborer

:wave: :wink:

rborer avatar Apr 16 '21 06:04 rborer