I am starting out using the search kit and am trying to connect to a local instance of Elasticsearch version 5.2. There is already an index, mapping and data in the Elasticsearch instance and I could query for the data using Kibana.
When the page loads, the result is always 0 results found. I am not even sure if it manages to connect to the local instance successfully. The code is:
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import registerServiceWorker from './registerServiceWorker';
import{SearchkitManager,SearchkitProvider,SearchBox,Hits,HitsStats} from "searchkit";
const searchkit = new SearchkitManager("http://localhost:9200");
ReactDOM.render((
<SearchkitProvider searchkit={searchkit}>
<div>
<SearchBox searchOnChange={true} queryFields={["productName"]} queryOptions={{analyzer:"standard"}}/>
<HitsStats translations={{
"hitstats.results_found":"{hitCount} results found"
}}/>
<Hits hitsPerPage={5}/>
</div>
</SearchkitProvider>), document.getElementById('root'));
registerServiceWorker();
I am probably doing something wrong or missing something. Could anyone help with this?