Skip to content

search: allow precomputing highlight decoration for streamed results

Administrator requested to merge rvt/end-to-end-hl into main

Created by: rvantonder

This makes it possible to stream precomputed highlighted content results via URL parameters. The hardcoded parameters in our web client means this change isn't "live" via the webapp until we implement a feature flag that overrides the parameters. It can be seen in action when using a plain URL like:

http://localhost:3081/search/stream?q=test%20type%3Afile%20&v=V2&t=literal&dl=10&dk=html&dc=1&display=1500

(the important part being dl=10).

️ Crucial thing I noticed ️: Streaming doesn't work locally because of some proxy issue. I believe it's because of the express proxy in the dev environment. If you try the above stream query on port 3080 or the https port, it won't stream for local dev, and this is not our backend issue. I spent a couple of hours trying to understand why flush didn't work. However, the results do stream for the ports behind the proxy, at 3081, and also 3082 I believe. I looked at some express http proxy stuff but couldn't figure out a fix.

In this PR, what doesn't work yet:

dc (for decorationContextLines argument) doesn't do anything yet. I have a work-in-progress branch for computing context lines and merging groups for rendering, but it needs more polish. Right now activating the stream highlighting will apply 0 context lines. The important part is that this PR will make it possible to stream end-to-end with some limit on the number of results, if we put it behind a feature flag. Context lines will just have to wait till I'm back 🙂

Merge request reports

Loading