圖解全文檢索索引SOLR的酷應用[Ajax Solr]

來源:互聯網
上載者:User

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 3: Add a pager 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 8: Add a map widget

· Step 9: Add a calendar widget

Step 10: Extra credit

基礎

以上應用的具體服務都是基於Solr的服務返回的Json資料,具體請求類似如下:

http://evolvingweb.ca/solr/reuters/select?facet=true&q=*%3A*&facet.field=topics&facet.field=organisations&facet.field=exchanges&facet.field=countryCodes&facet.limit=20&facet.mincount=1&f.topics.facet.limit=50&f.countryCodes.facet.limit=-1&facet.date=date&facet.date.start=1987-02-26T00%3A00%3A00.000Z%2FDAY&facet.date.end=1987-10-20T00%3A00%3A00.000Z%2FDAY%2B1DAY&facet.date.gap=%2B1DAY&json.nl=map&wt=json&json.wrf=jsonp1313733083156&_=1313733083258

 

http://evolvingweb.ca/solr/reuters/select?q=*:*&rows=0&facet=true&facet.limit=-1&facet.mincount=1&json.nl=map&facet.field=topics&facet.field=organisations&facet.field=exchanges&wt=json&json.wrf=jsonp1313733083157&_=1313733084113

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.