Settings

Theme

Ask HN: Best way to keep users interested? as my search takes time

1 points by debrajpal · 6 comments · 1 min read


Hey,

so on my product Minar we search in real time across site on the internet for what sites have the product you want. on average for a product you have asked for we search in 10-20 stores, and some stores are faster to response, while others may be slower. Irrespective, the full search takes between 8-10 seconds which is when we serve all the results to the frontend. Now, I have wanted to stream this for a while, where as we collect products for a site, we send that over to the frontend. Essentially serve the results to the API.

But how will the streaming work, in terms of how it is presented to the user is what I am wondering for the next update. Any ideas people?

For reference, you can take a look at the product and search at: https://www.theminarnet.com

1 thread
PaulHoule

Websockets.

  • debrajpalOP

    Does that require a unique id generated for each search request? assuming that should be from the frontend?

    • sfmz

      You can use the websocket pointer itself on the backend if you want.

      .NET looks like : Dict<WebSocket, List<resultObj>> webSocketConnections

      • debrajpalOP

        Right. But also from a streaming PoV in the frontend: how does that look? Have a bunch of products from X site (not ranked at all), have a bunch of products from Y site all come in sequentially. Been thinking of how to display them.

        Right now I get all products from all sites then rank and classify and categorise them.

        • sfmz

          As you get the results send them out (using async methods). As they arrive auto-sort them according to default user preference which is probably sort-by-price. Users will notice the scrollbar has increased in size or some other visual cue.

          • debrajpalOP

            hmm makes sense. I have some more thoughts on top of that in terms of exact product display UI

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection