Index Aliases _ Elasticsearch Reference.pdf - Learn/learn Docs/guide/contact EN PLEASE NOTE This page is for an older version of the software Check out

Index Aliases _ Elasticsearch Reference.pdf - Learn/learn...

  • No School
  • AA 1
  • 13

This preview shows page 1 - 5 out of 13 pages.

Docs (/guide) PLEASE NOTE: This page is for an older version of the software. Check out the latest version's documentation here (../current/index.html). Elasticsearch Reference [1.7] (index.html) » Indices APIs (indices.html) » Index Aliases « Delete Mapping (indices-delete-mapping.html) Update Indices Settings » (indices-update- settings.html) APIs in elasticsearch accept an index name when working against a speci呃Ȁc index, and several indices when applicable. The index aliases API allow to alias an index with a name, with all APIs automatically converting the alias name to the actual index name. An alias can also be mapped to more than one index, and when specifying it, the alias will automatically expand to the aliases indices. An alias can also be associated with a 呃Ȁlter that will automatically be applied when searching, and routing values. Here is a sample of associating the alias alias1 with index test1 : An alias can also be removed, for example: Index Aliases curl ‐XPOST '' ‐d ' { "actions" : [ { "add" : { "index" : "test1", "alias" : "alias1" } } ] }' edit () Learn (/learn) (/) (/contact) EN
Image of page 1

Subscribe to view the full document.

Renaming an alias is a simple remove then add operation within the same API. This operation is atomic, no need to worry about a short period of time where the alias does not point to an index: Associating an alias with more than one index are simply several add actions: Alternatively, you can use a glob pattern to associate an alias to more than one index that share a common name: curl ‐XPOST '' ‐d ' { "actions" : [ { "remove" : { "index" : "test1", "alias" : "alias1" } } ] }' curl ‐XPOST '' ‐d ' { "actions" : [ { "remove" : { "index" : "test1", "alias" : "alias1" } }, { "add" : { "index" : "test1", "alias" : "alias2" } } ] }' curl ‐XPOST '' ‐d ' { "actions" : [ { "add" : { "index" : "test1", "alias" : "alias1" } }, { "add" : { "index" : "test2", "alias" : "alias1" } } ] }'
Image of page 2
In this case, the alias is a point-in-time alias that will group all current indices that match, it will not automatically update as new indices that match this pattern are added/removed. It is an error to index to an alias which points to more than one index. Aliases with 呃Ȁlters provide an easy way to create di塔䌂erent "views" of the same index. The 呃Ȁlter can be de呃Ȁned using Query DSL and is applied to all Search, Count, Delete By Query and More Like This operations with this alias. To create a 呃Ȁltered alias, 呃Ȁrst we need to ensure that the 呃Ȁelds already exist in the mapping: Now we can create an alias that uses a 呃Ȁlter on 呃Ȁeld user : curl ‐XPOST '' ‐d ' { "actions" : [ { "add" : { "index" : "test*", "alias" : "all_test_indices" } } ] }' Filtered Aliases curl ‐XPUT '' ‐d '{ "mappings": { "type1": { "properties": { "user" : { "type": "string", "index": "not_analyzed" } } } } } edit ()
Image of page 3

Subscribe to view the full document.

It is possible to associate routing values with aliases. This feature can be used together with
Image of page 4
Image of page 5
  • Fall '19
  • Pseudonym, Elasticsearch, Doug Cutting, Alias, Nutch

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask 0 bonus questions You can ask 0 questions (0 expire soon) You can ask 0 questions (will expire )
Answers in as fast as 15 minutes