Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide an example with a local elasticsearch instance #104

Closed
bstaats opened this issue Oct 19, 2017 · 8 comments
Closed

Provide an example with a local elasticsearch instance #104

bstaats opened this issue Oct 19, 2017 · 8 comments

Comments

@bstaats
Copy link

bstaats commented Oct 19, 2017

Have not been able to find an example from anywhere yet. -Thanks

@aaronmyhre
Copy link

aaronmyhre commented Oct 19, 2017

<ReactiveBase url="http://localhost:9200/" app="app name" type="type name">

  • Remeber that an appbase "app" is synonymous with an ES "index"
  • Make sure that you are on version 1.0

@bstaats
Copy link
Author

bstaats commented Oct 19, 2017

So perhaps something else is going on cause I thought it was that simple too.

With this code:
<ReactiveBase app="reactiveapp" url="http://localhost:9200" type="purchases" theme="rbc-blue">

I get the following error:
VM1059:164 WebSocket connection to 'ws://localhost:9200/reactiveapp' failed: Error during WebSocket handshake: Unexpected response code: 404

I have also tried putting my ES index in "app" as well and I get the same error.

ES is running locally:
curl -XGET http://localhost:9200/ { "name" : "2tnQjI6", "cluster_name" : "elasticsearch", "cluster_uuid" : "7kV95RtQRJK5Kpg90z1Y-g", "version" : { "number" : "5.6.2", "build_hash" : "57e20f3", "build_date" : "2017-09-23T13:16:45.703Z", "build_snapshot" : false, "lucene_version" : "6.6.1" }, "tagline" : "You Know, for Search" }

@siddharthlatest
Copy link
Member

@bstaats That error is likely because of the underlying library trying to maintain a realtime subscription, something appbase.io offers but a generic ES cluster wouldn't. It shouldn't have any effect on the functioning of the app.

@bstaats
Copy link
Author

bstaats commented Oct 23, 2017

Yup, I looked at the underlying library and its connecting via a Websocket which ES does not accept. So the below article is misleading then. You are not able to connect reactivesearch components to ES. 😞 🐼

https://medium.appbase.io/reactive-search-v1-ui-components-for-elasticsearch-8d3506b534b2

@siddharthlatest
Copy link
Member

siddharthlatest commented Oct 23, 2017 via email

@aaronmyhre
Copy link

I don't know the specifics of your setup @bstaats, but I do have a working website with Reactive-Search pointed at a local version of ES....

@bstaats
Copy link
Author

bstaats commented Oct 23, 2017

I was able to get it to work. The missing piece was setting the correct access control for my local environment. For example:

http.cors.enabled: true
http.cors.allow-credentials: true
http.cors.allow-origin: /https?:\/\/(localhost)?(127.0.0.1)?(:[0-9]+)?/
http.cors.allow-headers: X-Requested-With, X-Auth-Token, Content-Type, Content-Length, Authorization, Access-Control-Allow-Headers, Accept

@bstaats bstaats closed this as completed Oct 23, 2017
@kevinsproles
Copy link

super helpful @bstaats thank you!

But what about the docs for how to setup your mappings? Obviously the data in your ES index and your mappings must conform to reactivesearch queries so wondering where I can read about how to setup the index & mappings.

The README say you can use "Any Elasticsearch index hosted on any Elasticsearch cluster."

bietkul pushed a commit that referenced this issue Sep 17, 2021
* feat: add docs for empty_query

* Update Rules.md

Co-authored-by: Siddharth Kothari <sids.aquarius@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants