elastix icon indicating copy to clipboard operation
elastix copied to clipboard

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

Open dalenavi opened this issue 6 years ago • 0 comments

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

dalenavi avatar May 03 '18 06:05 dalenavi