solr-client

A Solr client library for indexing, adding, deleting, committing, optimizing and searching documents within an Apache Solr installation (version>=3.2)

npm install solr-client
36 downloads in the last day
286 downloads in the last week
1 284 downloads in the last month

solr-client - a node.js solr client

Dependency Status

NPM

Install

npm install solr-client

Features

  • Commands supported: search(select), index, delete, update, commit, rollback, optimize, ping
  • Lucene query / DisMax query
  • Grouping / Field Collapsing. (Apache Solr version must be >= 3.3)
  • Convenients methods for querying with Facet, MoreLikeThis
  • HTTP Basic Access Authentication

Documentation

See the website at http://lbdremy.github.com/solr-node-client/.

Usage

// Load dependency
var solr = require('solr-client');

// Create a client
var client = solr.createClient();

// Add a new document
client.add({ id : 12, title_t : 'Hello' },function(err,obj){
   if(err){
      console.log(err);
   }else{
      console.log('Solr response:' + obj);
   }
});

Test

npm test

HTTP requests and responses expected are mocked thanks to nock. To disable the mocking go to test/config.json and set mocked to false.

Licence

(The MIT License) Copyright 2011-2012 HipSnip Limited

npm loves you