Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search Solr using POST instead of GET #129

Merged
merged 9 commits into from
Sep 7, 2015
Prev Previous commit
Next Next commit
Config Cleanup + Feedback Integration
 * `get_max` => `get_max_request_entity_size`
 * Removed local test core from the config
(cherry picked from commit ba9fa70)
kfitzgerald committed Aug 26, 2015
commit f247d34f3cfe774bca324a341db7ef2c07ede6ec
4 changes: 2 additions & 2 deletions lib/solr.js
Original file line number Diff line number Diff line change
@@ -83,7 +83,7 @@ function Client(options){
agent : options.agent,
secure : options.secure || false,
bigint : options.bigint || false,
get_max: options.get_max || 2048
get_max_request_entity_size: options.get_max_request_entity_size || 2048
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default it to false, so that this is not a breaking change
get_max_request_entity_size: options.get_max_request_entity_size || false

};

// Default paths of all request handlers
@@ -577,7 +577,7 @@ Client.prototype.get = function(handler,query,callback){
.join('/'),
approxUrlLength = 10 + this.options.host.length + (this.options.port+"").length + fullPath.length; // Buffer (10) accounts for protocol and special characters like ://, port colon, and initial slash etc

if (approxUrlLength <= this.options.get_max) {
if (approxUrlLength <= this.options.get_max_request_entity_size) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check if this.options.get_max_request_entity_size is truthy first to allow users to bypass this feature if they need to.
if(this.options.get_max_request_entity_size && approxUrlLength <= this.options.get_max_request_entity_size) {

var params = {
host: this.options.host,
port: this.options.port,
2 changes: 1 addition & 1 deletion test/config.json
Original file line number Diff line number Diff line change
@@ -3,6 +3,6 @@
"host": "127.0.0.1",
"port": 8983,
"path": "/solr",
"core": "solr_client_test"
"core": null
}
}