Skip to content

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

@dalenavi

Description

@dalenavi

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions