1 | #solr-client - a node.js solr client
|
2 |
|
3 | [![](https://secure.travis-ci.org/lbdremy/solr-node-client.png)](http://travis-ci.org/#!/lbdremy/solr-node-client)
|
4 |
|
5 | ##Install
|
6 |
|
7 | ```
|
8 | npm install solr-client
|
9 | ```
|
10 |
|
11 | ##Features
|
12 | - Commands supported: search(select), index, delete, update, commit, rollback, optimize, ping
|
13 | - Lucene query / DisMax query
|
14 | - Grouping / Field Collapsing. (Apache Solr version must be >= 3.3)
|
15 | - Convenients methods for querying with Facet, MoreLikeThis
|
16 | - HTTP Basic Access Authentication
|
17 |
|
18 | ##Documentation
|
19 | See the website at http://lbdremy.github.com/solr-node-client/.
|
20 |
|
21 | ##Usage
|
22 |
|
23 | ```js
|
24 | // Load dependency
|
25 | var solr = require('solr-client');
|
26 |
|
27 | // Create a client
|
28 | var client = solr.createClient();
|
29 |
|
30 | // Add a new document
|
31 | client.add({ id : 12, title_t : 'Hello' },function(err,obj){
|
32 | if(err){
|
33 | console.log(err);
|
34 | }else{
|
35 | console.log('Solr response:' + obj);
|
36 | }
|
37 | });
|
38 | ```
|
39 |
|
40 | ##Test
|
41 |
|
42 | ```js
|
43 | npm test
|
44 | ```
|
45 | HTTP requests and responses expected are mocked thanks to __nock__. To disable the mocking go to `test/config.json` and set `mocked` to `false`.
|
46 |
|
47 | ##Licence
|
48 | (The MIT License)
|
49 | Copyright 2011-2012 HipSnip Limited
|