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 6114wordpress-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 6114An 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
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\nUsing 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\nRemoving 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":"\n
What is an alias and how to create an alias in Elasticsearch? - Big Data In Real World<\/title>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\n\t\n\t\n