Skip to content

Instantly share code, notes, and snippets.

@voidberg
Created January 25, 2016 13:19
Show Gist options
  • Select an option

  • Save voidberg/620b11405af1a1373e8a to your computer and use it in GitHub Desktop.

Select an option

Save voidberg/620b11405af1a1373e8a to your computer and use it in GitHub Desktop.
A script to test a bug in solr-client.
var solr = require('solr-client');
var client = solr.createClient({
url: 'http://197.0.0.1:8983/solr',
core: 'core',
get_max_request_entity_size: 1024,
});
var query = client.createQuery();
var parts = [];
for (var i = 0; i < 1000; i++) {
parts.push('field_foo_i:' + i);
}
var fq = parts.join(' OR ');
query.set('fq=' + encodeURIComponent(fq));
client.search(query, function (err, results) {
if (err) {
console.log(err);
return;
}
console.log(results);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment