图解全文检索SOLR的酷应用[Ajax Solr]
Ajax Solr 是一个使用客户端Javascript库实现的基于Solr的应用库,提供了丰富的应用功能。
Ajax Solr is a client-side JavaScript library that can access Solr via its REST-like interface. Solr is not properly a database, but a search server; however it is the main data source for a search-based application. The result of using Ajax Solr for the user interface is literally having a JDBC (or PDO) Api available in the browser, which can make queries and change the results displayed basing on events generated by the user.
官方主页和具体的介绍
https://github.com/evolvingweb/ajax-solr
http://www.renren.it/a/JAVAbiancheng/JAVAzonghe/20100909/client-applications-ajax-solr.html
http://java.dzone.com/articles/client-applications-ajax-solr
例子Reuters tutorial:
https://github.com/evolvingweb/ajax-solr/wiki/reuters-tutorial
http://wenku.baidu.com/view/6830cd10f18583d04964590d.html
例子的下载:http://github.com/evolvingweb/ajax-solr/zipball/gh-pages
解压下载的文件,其中examples就是如下的具体效果,docs是库的API Docs说明,非常详细;lib就是这个库的javascript源代码
如下是每个例子的具体效果,可见关于搜索的各个方面在这个库基础都有丰富的体现,对于我们的常见应用有借鉴意义。
【如下的例子分步的差别使用红色框标注】
· Step 1: Talk to Solr
· Step 2: Add a results widget
· Step 4: Add a tagcloud widget
· Step 5: Display the current filters
· Step 6: Add a free-text widget
· Step 7: Add an autocomplete widget
· Step 9: Add a calendar widget
基础
以上应用的具体服务都是基于Solr的服务返回的Json数据,具体请求类似如下: