appbaseio / reactivesearch

Search UI components for React and Vue
https://opensource.appbase.io/reactivesearch
Apache License 2.0
4.9k stars 466 forks source link

Connnection unsuccessful to elasticsearch on localhost . #1934

Closed coolb0y closed 1 year ago

coolb0y commented 2 years ago

Discussed in https://github.com/appbaseio/reactivesearch/discussions/1933

Originally posted by **coolb0y** April 25, 2022 I used the sandbox code https://codesandbox.io/s/0yn05 . I put my index name as app name and credentials I put which I created during elasticsearch installation "elastic:somepassword" format and also link I gave was https://localhost:9200 . After setting all the cors setting in elasticsearch.yml . I found this error console ` {"type":"default","status":400,"ok":false,"statusText":"Bad Request","headers":{"map":{"content-length":"88","content-type":"application/json"}},"url":"https://localhost:9200/dataserver/_reactivesearch.v3","_bodyInit":{},"_bodyBlob":{},"bodyUsed":true}` Please help me .
stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

coolb0y commented 1 year ago

After One year I know the answer. This issue occurs either the index name you are providing is wrong i.e app name should be index name also this index should already exists in elasticsearch or opensearch if not create that index first. Second issue occurs which is mostly the case url="http://127.0.0.1:9200" app="datapp" credentials="user:pass" enableAppbase={false} enableAppbase should be false else it send request to /yourindex/_reactivesearch route which does not exists in elasticsearch instead of /yourindex/_msearch which exists in elasticsearch.