Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the becustom domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home4/joyplace/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the wordpress-seo domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home4/joyplace/public_html/wp-includes/functions.php on line 6114

Warning: Cannot modify header information - headers already sent by (output started at /home4/joyplace/public_html/wp-includes/functions.php:6114) in /home4/joyplace/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home4/joyplace/public_html/wp-includes/functions.php:6114) in /home4/joyplace/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home4/joyplace/public_html/wp-includes/functions.php:6114) in /home4/joyplace/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home4/joyplace/public_html/wp-includes/functions.php:6114) in /home4/joyplace/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home4/joyplace/public_html/wp-includes/functions.php:6114) in /home4/joyplace/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home4/joyplace/public_html/wp-includes/functions.php:6114) in /home4/joyplace/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home4/joyplace/public_html/wp-includes/functions.php:6114) in /home4/joyplace/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home4/joyplace/public_html/wp-includes/functions.php:6114) in /home4/joyplace/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1893
{"id":2238,"date":"2023-04-10T06:00:00","date_gmt":"2023-04-10T11:00:00","guid":{"rendered":"https:\/\/www.bigdatainrealworld.com\/?p=2238"},"modified":"2023-03-26T07:21:49","modified_gmt":"2023-03-26T12:21:49","slug":"what-is-an-alias-and-how-to-create-an-alias-in-elasticsearch","status":"publish","type":"post","link":"https:\/\/www.bigdatainrealworld.com\/what-is-an-alias-and-how-to-create-an-alias-in-elasticsearch\/","title":{"rendered":"What is an alias and how to create an alias in Elasticsearch?"},"content":{"rendered":"\n

An alias as the name suggests is an alias or another name to the index in Elasticsearch. It is quite useful when you want to refer to an index by another name. So instead of performing an reindex to rename or cloning an index you can create an alias to the index.<\/p>\n\n\n\n

Creating an alias<\/h2>\n\n\n\n

Here we are creating a new alias named account_alias to account index. <\/p>\n\n\n\n

curl -X POST \"localhost:9200\/_aliases?pretty\" -H 'Content-Type: application\/json' -d'<\/pre>\n\n\n\n
{\n  \"actions\" : [\n    { \"add\" : { \"index\" : \"account\", \"alias\" : \"account_alias\" } }\n  ]\n}'\n\n{\n  \"acknowledged\" : true\n}<\/pre>\n\n\n\n

Using the alias<\/h2>\n\n\n\n

We can now use the name account_alias in place of account. account_alias can be used in all places where we use account and using either account or account_alias will yield the same result because they both are pointing to the same index.<\/p>\n\n\n\n

\r\n[osboxes@wk1 ~]$ curl -X GET localhost:9200\/account\/_doc\/954?pretty\r\n{\r\n  \"_index\" : \"account\",\r\n  \"_type\" : \"_doc\",\r\n  \"_id\" : \"954\",\r\n  \"_version\" : 1,\r\n  \"_seq_no\" : 790,\r\n  \"_primary_term\" : 1,\r\n  \"found\" : true,\r\n  \"_source\" : {\r\n    \"account_number\" : 954,\r\n    \"balance\" : 49404,\r\n    \"firstname\" : \"Jenna\",\r\n    \"lastname\" : \"Martin\",\r\n    \"age\" : 22,\r\n    \"gender\" : \"M\",\r\n    \"address\" : \"688 Hart Street\",\r\n    \"employer\" : \"Zinca\",\r\n    \"email\" : \"jennamartin@zinca.com\",\r\n    \"city\" : \"Oasis\",\r\n    \"state\" : \"MD\"\r\n  }\r\n}\r\n[osboxes@wk1 ~]$ curl -X GET localhost:9200\/account_alias\/_doc\/954?pretty\r\n{\r\n  \"_index\" : \"account\",\r\n  \"_type\" : \"_doc\",\r\n  \"_id\" : \"954\",\r\n  \"_version\" : 1,\r\n  \"_seq_no\" : 790,\r\n  \"_primary_term\" : 1,\r\n  \"found\" : true,\r\n  \"_source\" : {\r\n    \"account_number\" : 954,\r\n    \"balance\" : 49404,\r\n    \"firstname\" : \"Jenna\",\r\n    \"lastname\" : \"Martin\",\r\n    \"age\" : 22,\r\n    \"gender\" : \"M\",\r\n    \"address\" : \"688 Hart Street\",\r\n    \"employer\" : \"Zinca\",\r\n    \"email\" : \"jennamartin@zinca.com\",\r\n    \"city\" : \"Oasis\",\r\n    \"state\" : \"MD\"\r\n  }\r\n}\r\n<\/pre>\n\n\n\n

Removing an alias<\/h2>\n\n\n\n

<\/p>\n\n\n\n

Note that when we remove an alias we specify remove under actions.<\/p>\n\n\n\n

curl -X POST \"localhost:9200\/_aliases?pretty\" -H 'Content-Type: application\/json' -d'\r\n{\r\n  \"actions\" : [\r\n    { \"remove<\/strong>\" : { \"index\" : \"account\", \"alias\" : \"account_alias\" } }\r\n  ]\r\n}'\r\n\r\n{\r\n  \"acknowledged\" : true\r\n}\r\n\r\n\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"

An alias as the name suggests is an alias or another name to the index in Elasticsearch. It is quite useful when you want to refer [\u2026]<\/span><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30],"tags":[],"class_list":["post-2238","post","type-post","status-publish","format-standard","hentry","category-elasticsearch"],"yoast_head":"\nWhat is an alias and how to create an alias in Elasticsearch? - Big Data In Real World<\/title>\n<meta name=\"description\" content=\"In this post we explain with examples what is an alias in Elasticsearch and how to create an alias with samples.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.bigdatainrealworld.com\/what-is-an-alias-and-how-to-create-an-alias-in-elasticsearch\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What is an alias and how to create an alias in Elasticsearch? - Big Data In Real World\" \/>\n<meta property=\"og:description\" content=\"In this post we explain with examples what is an alias in Elasticsearch and how to create an alias with samples.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.bigdatainrealworld.com\/what-is-an-alias-and-how-to-create-an-alias-in-elasticsearch\/\" \/>\n<meta property=\"og:site_name\" content=\"Big Data In Real World\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/bigdatainrealworld\" \/>\n<meta property=\"article:published_time\" content=\"2023-04-10T11:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-03-26T12:21:49+00:00\" \/>\n<meta name=\"author\" content=\"Big Data In Real World\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Big Data In Real World\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.bigdatainrealworld.com\/what-is-an-alias-and-how-to-create-an-alias-in-elasticsearch\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.bigdatainrealworld.com\/what-is-an-alias-and-how-to-create-an-alias-in-elasticsearch\/\"},\"author\":{\"name\":\"Big Data In Real World\",\"@id\":\"https:\/\/www.bigdatainrealworld.com\/#\/schema\/person\/24cab2292ef49c73053440c86515ef67\"},\"headline\":\"What is an alias and how to create an alias in Elasticsearch?\",\"datePublished\":\"2023-04-10T11:00:00+00:00\",\"dateModified\":\"2023-03-26T12:21:49+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.bigdatainrealworld.com\/what-is-an-alias-and-how-to-create-an-alias-in-elasticsearch\/\"},\"wordCount\":144,\"publisher\":{\"@id\":\"https:\/\/www.bigdatainrealworld.com\/#organization\"},\"articleSection\":[\"Elasticsearch\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.bigdatainrealworld.com\/what-is-an-alias-and-how-to-create-an-alias-in-elasticsearch\/\",\"url\":\"https:\/\/www.bigdatainrealworld.com\/what-is-an-alias-and-how-to-create-an-alias-in-elasticsearch\/\",\"name\":\"What is an alias and how to create an alias in Elasticsearch? - Big Data In Real World\",\"isPartOf\":{\"@id\":\"https:\/\/www.bigdatainrealworld.com\/#website\"},\"datePublished\":\"2023-04-10T11:00:00+00:00\",\"dateModified\":\"2023-03-26T12:21:49+00:00\",\"description\":\"In this post we explain with examples what is an alias in Elasticsearch and how to create an alias with samples.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.bigdatainrealworld.com\/what-is-an-alias-and-how-to-create-an-alias-in-elasticsearch\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.bigdatainrealworld.com\/what-is-an-alias-and-how-to-create-an-alias-in-elasticsearch\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.bigdatainrealworld.com\/what-is-an-alias-and-how-to-create-an-alias-in-elasticsearch\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.bigdatainrealworld.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"What is an alias and how to create an alias in Elasticsearch?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.bigdatainrealworld.com\/#website\",\"url\":\"https:\/\/www.bigdatainrealworld.com\/\",\"name\":\"Big Data In Real World\",\"description\":\"Learn Big Data from experts!\",\"publisher\":{\"@id\":\"https:\/\/www.bigdatainrealworld.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.bigdatainrealworld.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.bigdatainrealworld.com\/#organization\",\"name\":\"Big Data In Real World\",\"url\":\"https:\/\/www.bigdatainrealworld.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.bigdatainrealworld.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.bigdatainrealworld.com\/wp-content\/uploads\/2023\/02\/black.png\",\"contentUrl\":\"https:\/\/www.bigdatainrealworld.com\/wp-content\/uploads\/2023\/02\/black.png\",\"width\":500,\"height\":500,\"caption\":\"Big Data In Real World\"},\"image\":{\"@id\":\"https:\/\/www.bigdatainrealworld.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/bigdatainrealworld\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.bigdatainrealworld.com\/#\/schema\/person\/24cab2292ef49c73053440c86515ef67\",\"name\":\"Big Data In Real World\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.bigdatainrealworld.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d332bc24fe9b3182f0a22135f163ac4e?s=96&d=retro&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d332bc24fe9b3182f0a22135f163ac4e?s=96&d=retro&r=g\",\"caption\":\"Big Data In Real World\"},\"description\":\"We are a group of Big Data engineers who are passionate about Big Data and related Big Data technologies. We have designed, developed, deployed and maintained Big Data applications ranging from batch to real time streaming big data platforms. We have seen a wide range of real world big data problems, implemented some innovative and complex (or simple, depending on how you look at it) solutions.\",\"sameAs\":[\"https:\/\/www.bigdatainrealworld.com\/\"],\"url\":\"https:\/\/www.bigdatainrealworld.com\/author\/bigdatainrealworld\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What is an alias and how to create an alias in Elasticsearch? - Big Data In Real World","description":"In this post we explain with examples what is an alias in Elasticsearch and how to create an alias with samples.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.bigdatainrealworld.com\/what-is-an-alias-and-how-to-create-an-alias-in-elasticsearch\/","og_locale":"en_US","og_type":"article","og_title":"What is an alias and how to create an alias in Elasticsearch? - Big Data In Real World","og_description":"In this post we explain with examples what is an alias in Elasticsearch and how to create an alias with samples.","og_url":"https:\/\/www.bigdatainrealworld.com\/what-is-an-alias-and-how-to-create-an-alias-in-elasticsearch\/","og_site_name":"Big Data In Real World","article_publisher":"https:\/\/www.facebook.com\/bigdatainrealworld","article_published_time":"2023-04-10T11:00:00+00:00","article_modified_time":"2023-03-26T12:21:49+00:00","author":"Big Data In Real World","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Big Data In Real World","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.bigdatainrealworld.com\/what-is-an-alias-and-how-to-create-an-alias-in-elasticsearch\/#article","isPartOf":{"@id":"https:\/\/www.bigdatainrealworld.com\/what-is-an-alias-and-how-to-create-an-alias-in-elasticsearch\/"},"author":{"name":"Big Data In Real World","@id":"https:\/\/www.bigdatainrealworld.com\/#\/schema\/person\/24cab2292ef49c73053440c86515ef67"},"headline":"What is an alias and how to create an alias in Elasticsearch?","datePublished":"2023-04-10T11:00:00+00:00","dateModified":"2023-03-26T12:21:49+00:00","mainEntityOfPage":{"@id":"https:\/\/www.bigdatainrealworld.com\/what-is-an-alias-and-how-to-create-an-alias-in-elasticsearch\/"},"wordCount":144,"publisher":{"@id":"https:\/\/www.bigdatainrealworld.com\/#organization"},"articleSection":["Elasticsearch"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.bigdatainrealworld.com\/what-is-an-alias-and-how-to-create-an-alias-in-elasticsearch\/","url":"https:\/\/www.bigdatainrealworld.com\/what-is-an-alias-and-how-to-create-an-alias-in-elasticsearch\/","name":"What is an alias and how to create an alias in Elasticsearch? - Big Data In Real World","isPartOf":{"@id":"https:\/\/www.bigdatainrealworld.com\/#website"},"datePublished":"2023-04-10T11:00:00+00:00","dateModified":"2023-03-26T12:21:49+00:00","description":"In this post we explain with examples what is an alias in Elasticsearch and how to create an alias with samples.","breadcrumb":{"@id":"https:\/\/www.bigdatainrealworld.com\/what-is-an-alias-and-how-to-create-an-alias-in-elasticsearch\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.bigdatainrealworld.com\/what-is-an-alias-and-how-to-create-an-alias-in-elasticsearch\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.bigdatainrealworld.com\/what-is-an-alias-and-how-to-create-an-alias-in-elasticsearch\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.bigdatainrealworld.com\/"},{"@type":"ListItem","position":2,"name":"What is an alias and how to create an alias in Elasticsearch?"}]},{"@type":"WebSite","@id":"https:\/\/www.bigdatainrealworld.com\/#website","url":"https:\/\/www.bigdatainrealworld.com\/","name":"Big Data In Real World","description":"Learn Big Data from experts!","publisher":{"@id":"https:\/\/www.bigdatainrealworld.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.bigdatainrealworld.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.bigdatainrealworld.com\/#organization","name":"Big Data In Real World","url":"https:\/\/www.bigdatainrealworld.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.bigdatainrealworld.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.bigdatainrealworld.com\/wp-content\/uploads\/2023\/02\/black.png","contentUrl":"https:\/\/www.bigdatainrealworld.com\/wp-content\/uploads\/2023\/02\/black.png","width":500,"height":500,"caption":"Big Data In Real World"},"image":{"@id":"https:\/\/www.bigdatainrealworld.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/bigdatainrealworld"]},{"@type":"Person","@id":"https:\/\/www.bigdatainrealworld.com\/#\/schema\/person\/24cab2292ef49c73053440c86515ef67","name":"Big Data In Real World","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.bigdatainrealworld.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d332bc24fe9b3182f0a22135f163ac4e?s=96&d=retro&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d332bc24fe9b3182f0a22135f163ac4e?s=96&d=retro&r=g","caption":"Big Data In Real World"},"description":"We are a group of Big Data engineers who are passionate about Big Data and related Big Data technologies. We have designed, developed, deployed and maintained Big Data applications ranging from batch to real time streaming big data platforms. We have seen a wide range of real world big data problems, implemented some innovative and complex (or simple, depending on how you look at it) solutions.","sameAs":["https:\/\/www.bigdatainrealworld.com\/"],"url":"https:\/\/www.bigdatainrealworld.com\/author\/bigdatainrealworld\/"}]}},"_links":{"self":[{"href":"https:\/\/www.bigdatainrealworld.com\/wp-json\/wp\/v2\/posts\/2238","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bigdatainrealworld.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bigdatainrealworld.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bigdatainrealworld.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bigdatainrealworld.com\/wp-json\/wp\/v2\/comments?post=2238"}],"version-history":[{"count":1,"href":"https:\/\/www.bigdatainrealworld.com\/wp-json\/wp\/v2\/posts\/2238\/revisions"}],"predecessor-version":[{"id":2239,"href":"https:\/\/www.bigdatainrealworld.com\/wp-json\/wp\/v2\/posts\/2238\/revisions\/2239"}],"wp:attachment":[{"href":"https:\/\/www.bigdatainrealworld.com\/wp-json\/wp\/v2\/media?parent=2238"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bigdatainrealworld.com\/wp-json\/wp\/v2\/categories?post=2238"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bigdatainrealworld.com\/wp-json\/wp\/v2\/tags?post=2238"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}