Home > Enterprise >  Index not found when having cluster name in URL path
Index not found when having cluster name in URL path

Time:01-29

i have a local ES container running http://elasticsearch.net:9202 and i see a cluster by the name elasticsearch-dev with 1 node in it . When i make a Postman call to it like the following http://elasticsearch.localnet:9202/elasticsearch-dev/*/_search?q=order_number:102811901637201 I get

{
    "error": {
        "root_cause": [
            {
                "type": "index_not_found_exception",
                "reason": "no such index",
                "resource.type": "index_or_alias",
                "resource.id": "elasticsearch-dev",
                "index_uuid": "_na_",
                "index": "elasticsearch-dev" --------------------------- cluster name is reported back in as index name.
            }
        ],
        "type": "index_not_found_exception",
        "reason": "no such index",
        "resource.type": "index_or_alias",
        "resource.id": "elasticsearch-dev",
        "index_uuid": "_na_",
        "index": "elasticsearch-dev"
    },
    "status": 404
}

But if i query like http://elasticsearch.localnet:9202/*/_search?q=order_number:102811901637201. without the cluster name it works fine (200 response) .

Does ES cluster deployed locally (1 node )have a different URL pattern ?

CodePudding user response:

When you are running elasticsearch in your local system, the URL for index or search API is in the below format

http://{{hostname}}:{{es-port}}/{{index-name}}/_search

When running Elasticsearch in AWS EC2 instance, in that case also you can use this URL :

http://{{public-ip-of-cluster}}:{{es-port}}/{{index-name}}/_search
  •  Tags:  
  • Related