You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(Readme): Add some more information of how some new features work, add some examples, re-organized migration doc chronologically reverse to be more meaningful.
The only breaking change introduced in `v0.3.0` is about method chaining of the solr `Client`.
50
-
Method chaining as simply been removed because we were actually hidding something really interesting and useful
51
-
the `http.ClientRequest` instance.
62
+
No breaking change has been introduced to this release. However, to take advantage of facet.pivot and facet.pivot.mincount feature,
63
+
you'll need to pass a solrVersion parameter to the createClient() method.
52
64
53
-
So, before you could have done this:
65
+
Example:
54
66
55
67
```js
56
-
var client =solr.createClient();
68
+
// Will activate features specific to Solr4.0 and above (like facet.pivot and facet.pivot.mincount)
69
+
var client =solr.createClient({
70
+
solrVersion:'4.0'
71
+
});
72
+
```
57
73
58
-
client
59
-
.search('q=hello', function(err, obj){
60
-
console.log(err, obj);
61
-
})
62
-
.search('q=world', function(err, obj){
63
-
console.log(err, obj);
64
-
});
74
+
A feature allowing to support large queries by switching to POST when the query size reaches the threshold was introduced. To not become
75
+
a breaking change, it is by default turned OFF.
76
+
77
+
To activate it, pass the property `get_max_request_entity_size` to the createClient with the threshold in bytes. Minimum is 1.
78
+
79
+
Example:
80
+
81
+
```js
82
+
// Will switch to POST as soon as the query size reaches 1000 bytes (limit in servers is usually 2048 or 8192)
83
+
// You can set it to 1 so every request will always use POST.
84
+
var client =solr.createClient({
85
+
get_max_request_entity_size:1000
86
+
});
65
87
```
66
88
67
-
Now it won't work, but you have now access to the `http.ClientRequest` instead created by `Client#search`:
89
+
##Migration between 0.4.x and 0.5.x
90
+
91
+
The only breaking change introduced in `0.5.x` is introduced in this commit [3cbc7fc6cf631f019a4626913c0a4b616092133b](https://github.com/lbdremy/solr-node-client/commit/3cbc7fc6cf631f019a4626913c0a4b616092133b) which remove escaping of the Solr special characters in some of the methods of the `Query` class i.e in `Query#rangeFilter`, `Query#matchFilter`, `Query#group`, `Query#facet`, `Query#mlt` if you were relying on this behavior just wrap the arguments you passed to those methods into the [`solr.escapeSpecialChars(arg)`](https://github.com/lbdremy/solr-node-client/blob/master/lib/solr.js#L605) method.
92
+
93
+
For example, for some weird reason you wanted to escape the special char `*`, don't ask me ;)
68
94
69
95
```js
70
-
var client =solr.createClient();
96
+
var query =client.createQuery();
97
+
query.q({ '*':'*' }).rangeFilter({ field :'id', start :100, end :'*'})
98
+
```
71
99
72
-
var request =client.search('q=hello', function(err, obj){
73
-
console.log(err, obj);
74
-
});
75
-
request.setTimeout(200, function(){
76
-
console.log('search timeout');
77
-
});
100
+
You still can:
101
+
102
+
```js
103
+
var query =client.createQuery();
104
+
query.q({ '*':'*' }).rangeFilter({ field :'id', start :100, end :solr.escapeSpecialChars('*')})
78
105
```
79
106
80
-
Post an issue if you have troubles migrating to v0.3.0.
107
+
Post an issue if you have troubles migrating to v0.5.0.
Post an issue if you have troubles migrating to v0.4.0.
99
126
100
-
##Migration between 0.4.x and 0.5.x
127
+
##Migration between 0.2.x and 0.3.x
101
128
102
-
The only breaking change introduced in `0.5.x` is introduced in this commit [3cbc7fc6cf631f019a4626913c0a4b616092133b](https://github.com/lbdremy/solr-node-client/commit/3cbc7fc6cf631f019a4626913c0a4b616092133b) which remove escaping of the Solr special characters in some of the methods of the `Query` class i.e in `Query#rangeFilter`, `Query#matchFilter`, `Query#group`, `Query#facet`, `Query#mlt` if you were relying on this behavior just wrap the arguments you passed to those methods into the [`solr.escapeSpecialChars(arg)`](https://github.com/lbdremy/solr-node-client/blob/master/lib/solr.js#L605) method.
129
+
The only breaking change introduced in `v0.3.0` is about method chaining of the solr `Client`.
130
+
Method chaining as simply been removed because we were actually hidding something really interesting and useful
131
+
the `http.ClientRequest` instance.
103
132
104
-
For example, for some weird reason you wanted to escape the special char `*`, don't ask me ;)
133
+
So, before you could have done this:
105
134
106
135
```js
107
-
var query =client.createQuery();
108
-
query.q({ '*':'*' }).rangeFilter({ field :'id', start :100, end :'*'})
136
+
var client =solr.createClient();
137
+
138
+
client
139
+
.search('q=hello', function(err, obj){
140
+
console.log(err, obj);
141
+
})
142
+
.search('q=world', function(err, obj){
143
+
console.log(err, obj);
144
+
});
109
145
```
110
146
111
-
You still can:
147
+
Now it won't work, but you have now access to the `http.ClientRequest` instead created by `Client#search`:
112
148
113
149
```js
114
-
var query =client.createQuery();
115
-
query.q({ '*':'*' }).rangeFilter({ field :'id', start :100, end :solr.escapeSpecialChars('*')})
150
+
var client =solr.createClient();
151
+
152
+
var request =client.search('q=hello', function(err, obj){
153
+
console.log(err, obj);
154
+
});
155
+
request.setTimeout(200, function(){
156
+
console.log('search timeout');
157
+
});
116
158
```
117
159
118
-
Post an issue if you have troubles migrating to v0.5.0.
160
+
Post an issue if you have troubles migrating to v0.3.0.
0 commit comments