appbaseio / reactivesearch

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

Access problem to my Elastic cluster #279

Closed ymzoughi closed 6 years ago

ymzoughi commented 6 years ago

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

metagrover commented 6 years ago

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.

ymzoughi commented 6 years ago

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>
metagrover commented 6 years ago

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.

siddharthlatest commented 6 years ago

@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.

ymzoughi commented 6 years ago

@siddharthlatest it works on servers but not others

siddharthlatest commented 6 years ago

@ymzoughi Can you elaborate? Not sure I understand.

ymzoughi commented 6 years ago

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

siddharthlatest commented 6 years ago

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

ymzoughi commented 6 years ago

@siddharthlatest ES6

siddharthlatest commented 6 years ago

@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 commented 6 years ago

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.

metagrover commented 6 years ago

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

metagrover commented 6 years ago

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