Unable to Connect to Elasticsearch using Searchkit

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.

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((


<SearchBox searchOnChange={true} queryFields={["productName"]} queryOptions={{analyzer:"standard"}}/>
<HitsStats translations={{
"hitstats.results_found":"{hitCount} results found"
}}/>


), document.getElementById('root'));

registerServiceWorker();

I am probably doing something wrong or missing something. Could anyone help with this?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.