douhuo3696 2013-02-28 08:09
浏览 53

实时搜索结果

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?

  • 写回答

1条回答 默认 最新

  • dswqw66280 2013-02-28 14:55
    关注

    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.

    评论

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!