0

I have connected my ElasticSearch server using ReactiveSearch react client successfully. When I query the server using Datasearch component, I can see in the network logs that it makes the query to the right index and hits the endpoint of _msearch that returns the expected responses. However, the results don't get bind to the search box and nothing happens on the ui.

Here is the definition:

const url = "server-url.xxxxx.xx";
const token = "auth-token-for-access";
const index = "random-index";
const apiKey = `ApiKey ${token}`
const headers = {
  Authorization: `ApiKey ${token}`,
  "Content-Type": "application/x-ndjson"
}

const App = () => (
  <ReactiveBase
    app={index}
    url={url}
    headers={headers}
  >
    <DataSearch
        componentId="searchComponent"
        dataField={["nom", "pre_nom"]}
        autosuggest={true}
        placeholder="Search for name"
    />
  </ReactiveBase>
);

I am using "@appbaseio/reactivesearch": "3.43.10" without any custom css or anything else. Here are the network logs:

network log

Payload for the document:

"_source":{
   "nom":"",
   "origine":"xxxx",
   "prenom":"aaaa",
   "province":"bbbbb",
   "page":8,
   "pays":"yyyy",
   "@timestamp":"2023-05-11T17:30:51.381159300Z"
}

Not sure what is going wrong or missing, any help would be great! Thanks in advance.

faizanjehangir
  • 2,771
  • 6
  • 45
  • 83

0 Answers0