i am new in react and have a problem. I wanted to create a simple search page for the beginning and I already have an elasticsearch cluster.
I followed this tutorial: https://codeburst.io/how-to-build-an-e-commerce-search-ui-with-react-and-elasticsearch-a581c823b2c3
the example works as it should. now i have adapted the example to my needs:
import React, { Component } from "react";
import "./../index.css";
import { ReactiveBase, DataSearch, SingleRange, ResultCard, CategorySearch, ReactiveList, SingleList, MultiList, ResultCardsWrapper } from '@appbaseio/reactivesearch';
class ReactiveSearchP extends Component {
render() {
return (
<ReactiveBase
app="index"
url="https://page:port"
credentials="user:pw"
>
<DataSearch
componentId="mainSearch"
dataField={["article"]}
queryFormat="and"
iconPosition="left"
/>
<MultiList
componentId="price"
dataField="price.raw"
title="Price"
size={5}
/>
<ResultCard
componentId="results"
dataField="article"
react={{
"and": ["mainSearch", "price"]
}}
onData={(res)=>({
"image": res.image,
"title": res.article
})}
/>
</ReactiveBase>
);
}
}
export default ReactiveSearchP;
For legal reasons I am not allowed to give the reactivebase probs.
My problem now is when i test this code, there is only a white page. If I delete the resultcard component, everything is displayed as intended.
So I'm looking for a solution to display my search results as a result card, but I don't find any. I've tried several tutorials but I can't get it.
Would be glad if someone could help me. If information is still missing, let me know.
Thanks