实时搜索结果

I'm building a customized search engine. In my program, it takes a little while for each search result to show up. What I'm looking for is a way to show the search result item on the user's browser, as soon as it is found.

The most related thing to this that comes to my mind, is WPF's binding. When you bind a list of items to a ListView, as soon as you add an item to the list, it will show up in the UI. I'd like to implement something like that.

In .Net & C# world, I've played a little with concepts like SignalR, web sockets, etc. but I'm no expert but I know jQuery fairly well. However, I'm looking to implement this in Java (which is my server's back-end) and PHP (as the front-end). My previous static (without the feature I described) search engine is implemented using Thrift as a web service to communicate between the Java server and PHP (more on how to do that). Can I expand the current implementation and add this feature? How?

For the middle tire you would need something that supports well web sockets. So when new result arrives from backend, middle tire would forward it over the web socket to the client in browser. Javascript code would receive object on web socket, and dynamically add new search result to the div with results.