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

Elasticsearch host with path (http://myhost/namespacedir) is stripped of path (/namespacedir) #49

Open
dalenavi opened this issue May 3, 2018 · 0 comments · May be fixed by #50
Open

Comments

@dalenavi
Copy link

dalenavi commented May 3, 2018

Given an elasticsearch target, namespaced into a sub-path by nginx,
when I pass the full host+path into Elastix.Search.search (and other functions also)
then the path component of the elasticsearch url is stripped away.

I believe this code is problematic, in search.ex

def make_path(index, types, query_params, api_type \\ "_search") do
    path_root = "/#{index}"

When the index+type+queryparam path is passed to URI.merge, in prepare_url,
the preceding forwardslash in the index path replaces any existing path in the host url,
since URI.merge follows Relative Resolution of RFC 3986

evuez added a commit that referenced this issue May 3, 2018
@evuez evuez linked a pull request May 3, 2018 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants