reactivesearch icon indicating copy to clipboard operation
reactivesearch copied to clipboard

Access problem to my Elastic cluster

Open ymzoughi opened this issue 8 years ago • 13 comments

Issue Type: Bug

Description: I tried to connect Reactive Search to my Elastic cluster with ReactiveBase components, but the problem is that I have an extra "/" in the url

Screenshots: capture d ecran 2018-02-22 a 10 49 37 am

Reactivesearch version: V2

Browser: all

ymzoughi avatar Feb 22 '18 09:02 ymzoughi

It seems like you're missing app prop here maybe. What have you set ReactiveBase component props here?

app should be the index of your Elasticsearch cluster.

metagrover avatar Feb 22 '18 09:02 metagrover

Hello @metagrover, thank you for the replay There is my config in the ReactiveBase componenents

<ReactiveBase
        url="http://localhost:11000/ads"
        app="autos">
        <CategorySearch
            componentId="searchbox"
            dataField="name"
            categoryField="brand.raw"
            placeholder="Search for cars"
        />
      </ReactiveBase>

ymzoughi avatar Feb 22 '18 10:02 ymzoughi

oh it seems like a bug in the library 😅. We will fix this in the next release. But for quick solution here, you can specify the type prop in ReactiveBase and it should work.

metagrover avatar Feb 22 '18 10:02 metagrover

@ymzoughi I can see the extra slash, but does that affect a query in any way? I am able to run /_search against an ES cluster with an extra slash just fine.

siddharthlatest avatar Feb 22 '18 11:02 siddharthlatest

@siddharthlatest it works on servers but not others

ymzoughi avatar Feb 22 '18 11:02 ymzoughi

@ymzoughi Can you elaborate? Not sure I understand.

siddharthlatest avatar Feb 22 '18 11:02 siddharthlatest

@siddharthlatest it works with my production cluster, but not with the local one

ymzoughi avatar Feb 22 '18 11:02 ymzoughi

@ymzoughi What version of Elasticsearch does your local cluster run?

siddharthlatest avatar Feb 22 '18 11:02 siddharthlatest

@siddharthlatest ES6

ymzoughi avatar Feb 22 '18 11:02 ymzoughi

@ymzoughi I am not able to replicate the issue, tried with v6.2.2. If you can share the response or logs from ES, I can tell better. But my hunch is that the extra slash isn't causing the issue.

siddharthlatest avatar Feb 22 '18 12:02 siddharthlatest

Update: I am able to replicate the issue when there is an extra slash after the type name.

@metagrover This happens when a type is present in the request and the request URI looks like /app/type//_search... when you access a raw Elasticsearch URI. Most middlewares should be able to correct the URI which explains why it's not happening on appbase.io service and @ymzoughi's production server.

siddharthlatest avatar Feb 22 '18 14:02 siddharthlatest

Got it! Thanks for the details. Will fix this shortly 👍

metagrover avatar Feb 22 '18 14:02 metagrover

Fixed in the latest appbase-js release and should be out in v2.3.0 :tada:

metagrover avatar Feb 28 '18 12:02 metagrover