UNPKG

1.35 kBMarkdownView Raw
1#Solr Client API
2
3##Features
4 - Support commands: Query, Delete, Update, Commit, Rollback, Optimize
5 - Support Dismax Query Syntax
6 - Support implicit conversion for `Date` Object to the supported format by Solr.
7 More informations available about [the Solr Date Format](http://lucidworks.lucidimagination.com/display/LWEUG/Solr+Date+Format).
8
9##History
10 - _!WARNING!_ On the v0.0.3 I [standardized error handling](http://docs.nodejitsu.com/articles/errors/what-are-the-error-conventions) in asynchronous functions by returning them as the first argument to the current function's callback and not as the second argument like it's was the case on version < 0.0.3. This modification can break you code have a look to your code before you update.
11
12##Install
13 npm install solr-client
14
15##Get started
16 // Dependency
17 var solr = require('solr-client');
18
19 //Create Client
20 var client = solr.createClient();
21
22 //Add
23 var doc = {
24 field : 'value';
25 }
26 var callback = function(err,res){
27 if(err) console.log(err);
28 if(res) console.log(res);
29 }
30 client.add(doc,callback);
31 client.commit(callback);
32
33
34##Test
35Before to run the test, start the Solr Server.
36
37 vows --spec test/*
38##Examples
39
40Take a look in the [folder examples](https://github.com/lbdremy/solr-node-client/tree/master/examples).
41
\No newline at end of file