Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using ReactiveSearch with plain elasticsearch

I'd like to use reactivesearch with my own plain vanilla elasticsearch cluster. While the example and documentation describe that this should be possible: ReactiveBase, see the url Param. I get connection errors and a Websocket call wss://.. which looks like ReactiveBase is trying to connect to a appbase.io hosted elastic instead. It also passes a credentials code along with the call to elastic which is not specified in my code.

Is it possible to connect to a normal elastic and where can I find the documentation on how to do this?

This is my definition of ReactiveBase:

<ReactiveBase app="documents"url="https://search-siroop-3jjelqkbvwhzqzsolxt5ujxdxm.eu-central-1.es.amazonaws.com/">

Connection Errors

To implement this example I followed the ReactiveSearch Quickstart

like image 835
paweloque Avatar asked Sep 15 '26 21:09

paweloque


1 Answers

Yes, it's possible to connect to a normal Elasticsearch cluster (docs) with reactivesearch. It seems you're using the correct props. Sample code:

<ReactiveBase
  app="your-elasticsearch-index"
  url="http://your-elasticsearch-cluster"
>
    <Component1 .. />
    <Component2 .. />
</ReactiveBase>

The app prop refers to the index name. Looks like you're using this with AWS. Since AWS doesn't allow you to configure ES settings, you might need to use a middleware proxy server. From the docs:

If you are using Elasticsearch on AWS, then the recommended approach is to connect via the middleware proxy as they don’t allow setting the Elasticsearch configurations.

The docs also explain how you can write your own proxy server.

TLDR:

  • Proxy server
  • Using the proxy server in client app with reactivesearch

The connection error related to websockets you see here isn't causing the issue. It's used for streaming which works on appbase.io. This has been fixed in the 2.2.0 release. Hope this helps :)

like image 91
Divyanshu Maithani Avatar answered Sep 19 '26 00:09

Divyanshu Maithani



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!