lbdremy/solr-node-client — pull request #82 by maxcnunes (2014-05-02 03:31:59+00:00)
Title: adding query builder support

Specific query builder support for the "q" parameter.

I have included support for:
- where
- equals
- in
- blocks - "(" and ")"
- or
- any
- between
- less than - lt
- greater than - gt

Example:
```js
var qb = new SolrQueryBuilder();

if (opt.city) qb.where('city').in(opt.city);
if (opt.status) qb.where('status', opt.status);
if (opt.age) qb.where('age').equals(opt.age);

if (opt.startDate || opt.endDate) {
qb.where('birthDate').between(opt.startDate, opt.endDate);
}

if (opt.offset_date && opt.offset_id) {
qb.begin()
.where('birthDate').lt(opt.offset_date)
.or()
.begin()
.where('birthDate').equals(opt.offset_date)
.where('_id').lt(opt.offset_id)
.end()
.end();
}

if (opt.name) {
qb.any({ firstName: opt.name, middleName: opt.name, lastName: opt.name });
}

var client = solr.createClient();

var query = client.createQuery()
.q(qb.build())
.start(0)
.rows(10);
```