1 | #solr-client - a node.js solr client
|
2 |
|
3 | ##Install
|
4 |
|
5 | ```
|
6 | npm install solr-client
|
7 | ```
|
8 |
|
9 | ##Usage
|
10 |
|
11 | ```js
|
12 | // Load dependency
|
13 | var solr = require('solr-client');
|
14 |
|
15 | // Create a client
|
16 | var client = solr.createClient();
|
17 |
|
18 | // Add a new document
|
19 | client.add({ id : 12, title_t : 'Hello' },function(err,json){
|
20 | if(err){
|
21 | console.log(err);
|
22 | }else{
|
23 | console.log('JSON response:' + json);
|
24 | }
|
25 | });
|
26 | ```
|
27 |
|
28 | ##Commands & API supported
|
29 | - commands: query, delete, update, commit, rollback, optimize, ping
|
30 | - Lucene query / DisMax query
|
31 | - Grouping / Field Collapsing. (Apache Solr version must be [>= 3.3](http://svn.apache.org/repos/asf/lucene/dev/tags/lucene_solr_3_3/solr/CHANGES.txt))
|
32 | - Facet
|
33 | - HTTP Basic Access Authentication
|
34 |
|
35 | ##Test
|
36 | Before to run the test, start the Solr server.
|
37 |
|
38 | ```js
|
39 | npm test
|
40 | ```
|
41 |
|
42 | ##Licence
|
43 | (The MIT License)
|
44 | Copyright 2011-2012 HipSnip Limited
|