appbaseio / appbaseio/reactivecore

Error on response after modifying request API from _msearch to _search

Open
#47 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
33
Forks
27
PR merge metrics
No merged PRs in 30d

Description

**Affected Projects**: Reactivesearch / ReactiveCore

**Library Version:** 3.0.1

**Describe the bug**
Using the [Reactivesearch documentation as a baseline](https://docs.appbase.io/docs/reactivesearch/v3/overview/reactivebase/), I changed the request API endpoint as follow:
![image](https://user-images.githubusercontent.com/26316855/64986871-512f5680-d89e-11e9-8377-4c852cea9528.png)
The request was processed nicely by Elasticsearch. However, the following error was thrown while the library was processing the response:
![image](https://user-images.githubusercontent.com/26316855/64986757-1decc780-d89e-11e9-91c7-31b6656ece68.png)
As I checked, the problem is that the **handleResponse** method tries to directly access a "responses" property from the body, and the search API doesn't return an array of responses - it returns a single response.
![image](https://user-images.githubusercontent.com/26316855/64987416-7e303900-d89f-11e9-99b9-ffeea410257e.png)

**To Reproduce**
Steps to reproduce the behavior:
Just modify any request using **transformRequest** as described above.

**Expected behavior**
The single response from the **_search** API should be processed succesfully.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.