title: Python: elasticsearch.exceptions.NotFoundError: NotFoundError(404, '{"code":404,"message":"HTTP 404 Not Found"}')
body: <p>I want to GET the data from a given URL (with a prefix) using ElasticSearch in Python. Here is my code:</p>
  <pre><code>if __name__ == '__main__':
      username = &quot;xxxx&quot;
      password = &quot;xxxx&quot;
      url = &quot;http://xxxx.xxx:80/xxxx/xxxx/&quot; 
    
      _es = Elasticsearch([url], http_auth=(username, password))
      if _es.ping():
          print('Connect')
          print(_es)
          res = _es.search(index='index1', body={&quot;query&quot;: {&quot;match_all&quot;: {}}})
          print(res)
      else:
          print('It could not connect!')
  </code></pre>
  <p>Actually, I can ping _e, and the _es will be an elastic object as:</p>
  <blockquote>
  <p>&lt;Elasticsearch([{'host': 'xxxx.xxx', 'url_prefix': 'xxxx/xxxx/', 'port': 80}])&gt;</p>
  </blockquote>
  <p>Also, to verify my URL, port and prefix, I checked it in Postman, I can get the data in a Json format correctly. But when I run the code in Python, I recieved the following error:</p>
  <pre><code>Connect
  &lt;Elasticsearch([{'host': 'xxxx.xxx', 'url_prefix': 'xxxx/xxxx/', 'port': 80}])&gt;
  Traceback (most recent call last):
    File &quot;/----.py&quot;, line 29, in &lt;module&gt;
      res = _es.search(index='index1', body={&quot;query&quot;: {&quot;match_all&quot;: {}}})
    File &quot;/usr/local/lib/python3.5/dist-packages/elasticsearch/client/utils.py&quot;, line 139, in _wrapped
      return func(*args, params=params, headers=headers, **kwargs)
    File &quot;/usr/local/lib/python3.5/dist-packages/elasticsearch/client/__init__.py&quot;, line 1484, in search
      body=body,
    File &quot;/usr/local/lib/python3.5/dist-packages/elasticsearch/transport.py&quot;, line 352, in perform_request
      timeout=timeout,
    File &quot;/usr/local/lib/python3.5/dist-packages/elasticsearch/connection/http_urllib3.py&quot;, line 256, in perform_request
      self._raise_error(response.status, raw_data)
    File &quot;/usr/local/lib/python3.5/dist-packages/elasticsearch/connection/base.py&quot;, line 288, in _raise_error
      status_code, error_message, additional_info
  elasticsearch.exceptions.NotFoundError: NotFoundError(404, '{&quot;code&quot;:404,&quot;message&quot;:&quot;HTTP 404 Not Found&quot;}')
  </code></pre>
  <p>Any Idea?</p>