-
Notifications
You must be signed in to change notification settings - Fork 17
[fix] search API: "sort" and "search_after" must be in the requests body #384
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
Conversation
Codecov Report
@@ Coverage Diff @@
## 6-dev #384 +/- ##
==========================================
+ Coverage 96.73% 96.73% +<.01%
==========================================
Files 30 30
Lines 1438 1439 +1
==========================================
+ Hits 1391 1392 +1
Misses 47 47
Continue to review full report at Codecov.
|
const key = typeof sort === 'string' | ||
? sort | ||
: Object.keys(sort)[0]; | ||
const value = key === '_uid' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(nitpicking) maybe adding parentheses make it more readable
const value = key === '_uid' | |
const value = (key === '_uid') |
request.body.search_after = []; | ||
|
||
for (const sort of this._request.body.sort) { | ||
const key = typeof sort === 'string' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(nitpicking) maybe adding parentheses here make it more readable
const key = typeof sort === 'string' | |
const key = (typeof sort === 'string') |
# [6.1.1](https://github.com/kuzzleio/sdk-javascript/releases/tag/6.1.1) (2019-04-29) #### Bug fixes - [ [#384](#384) ] [fix] search API: "sort" and "search_after" must be in the requests body ([scottinet](https://github.com/scottinet)) #### Enhancements - [ [#388](#388) ] Use BaseController class for controllers ([Aschen](https://github.com/Aschen)) - [ [#385](#385) ] Add Realtime.createRestrictedUser method ([Aschen](https://github.com/Aschen)) #### Others - [ [#387](#387) ] SearchResult.next returns a new instance ([Aschen](https://github.com/Aschen)) ---
Release 6.1.2 Bug fixes [ #398 ] Fix bulk return (Aschen) [ #394 ] Add default values for from/size to document:search (Aschen) [ #384 ] Fix search API: "sort" and "search_after" must be in the requests body (scottinet) Enhancements [ #390 ] Add authenticated property on Kuzzle object (Aschen) [ #395 ] Proxify kuzzle to avoid mistyping error (thomasarbona) [ #389 ] Remove usage of _meta (Aschen) [ #391 ] Add isConnected (Aschen) [ #388 ] Use BaseController class for controllers (Aschen) [ #385 ] Add Security.createRestrictedUser method (Aschen) Others [ #400 ] Fix large document search using scroll (stafyniaksacha) [ #387 ] SearchResult.next returns a new instance (Aschen)
Description
The
SearchResult
class sends asearch_after
request to Kuzzle upon calling itsnext
method, if:size
option is providedsort
modifierThe current implementation considers that
sort
must be at the root of the API request, while Kuzzle expects it inside the body part of it.Same thing goes for the
search_after
argument, which must be put in the request body, not at root level.