Wednesday, October 28, 2009

Introducing the AJAX Solr library

Talked to the Lucid Imagineers a short while ago. Lots of neat stuff going on with respect to Solr 1.4. It seems Matthias Epheser's SolrJS (a JavaScript library for creating user interfaces to Apache Solr) has been forked and reincarnated as AJAX Solr. The SolrJS library (originally a Google Summer of Code project) had dependencies on jQuery. To their credit, the Solr team decided that being chained to someone's choice of a single rather large AJAX framework might not be such a good thing in every user's eyes. AJAX Solr, by contrast, is JavaScript framework-agnostic, thus can be used in conjunction with jQuery, MooTools, Prototype, Dojo, or any other framework that implements AJAX helper objects. The programmer who uses AJAX Solr only has to define a Manager object that extends the AbstractManager object, implementing an executeRequest() method. A jQuery-compatible Manager looks like the following (code available at managers/Manager.jquery.js):

AjaxSolr.Manager = AjaxSolr.AbstractManager.extend({
canAddWidget: function (widget) {
return widget.target === undefined ||
jQuery
(widget.target) && jQuery(widget.target).length;
},
/**
* @see http://wiki.apache.org/solr/SolJSON#JSON_specific_parameters
*/
executeRequest: function (queryObj) {
var queryString = this.buildQueryString(queryObj);
// For debugging purposes
this.queryStringCache = queryString;
var me = this;
if (this.passthruUrl) {
jQuery.post(this.passthruUrl + '?callback=?',
{ query: queryString },
this.jsonCallback(), 'json');
}
else {
jQuery.getJSON(this.solrUrl +
'/select?'
+ queryString +
'&wt=json&json.nl=map&json.wrf=?&jsoncallback=?'
,
{},
this.jsonCallback());
}
}
});

bookmark and share this

5 comments:

  1. Good,informative and interesting introduction about AJAX Solr library.Keep blogging and thanks for sharing.

    Regards,
    clipping path service provider

    ReplyDelete
  2. Many packers and movers Hyderabad, Telangana may boast about offering a huge list of services with little to no skill or expertise to carry out those services as required. You need to check with every packer and mover if they have the experience to fulfil your specific requirements properly, and will complete your relocation in the most cost-effective way possible.
    Movers and Packers in Gachibowli
    Movers and Packers in Kukatpally
    Movers and Packers in Chanda Nagar
    Movers and Packers in Manikonda

    ReplyDelete
  3. Many packers and movers Hyderabad, Telangana may boast about offering a huge list of services with little to no skill or expertise to carry out those services as required.
    Packers and Movers in Madhapur
    Packers and Movers in Gachibowli
    Packers and Movers in Chanda Nagar
    Packers and Movers in Nallagandla
    Packers and Movers in Kukatpally

    ReplyDelete
  4. On top of the high standard we will treat your fragile goods to, we will take the same due care and attention when packing up the entirety of your goods from your home.
    Movers and Packers in Chembur
    Movers and Packers in Jogeshwari
    Movers and Packers in Kharghar
    Movers and Packers in Dombivli

    ReplyDelete
  5. Though we manufacture different products but among all office furniture chairs are the most demanded. We not only deal with local clients but also with national and international clients. The products that we manufacture are supplied to various offices, hospitals, auditoriums, cafeteria, homes and schools.
    Visitor Chair Supplier in Mumbai
    Chair Dealers in Mumbai
    Top Chair Manufacturers in Mumbai
    Best Chair Manufacturers in Mumbai

    ReplyDelete

Add a comment. Registration required because trolls.