Elasticsearch Index aliases

Elasticsearch allows the user to create an alias to the indices.

For example, if we are maintaining a different range of employee details in different indices. And we want to query the employee details of all ranges from our application. We can create an alias for our existing indices.

So that we can query all the needed indices with a single endpoint. If we are frequently adding new indices to our data sources. we don’t need to update every time in the application configuration part if we are using alias concept.

Whenever we are adding new indices to our data source, we can simply add the new index to alias. The endpoint will remain the same, we add our additional index without affecting our application (let’s say we are pointing our website to Elasticsearch for data set).

Index 1: sales-people

Index2: research-people

Index 3: management-people

Alias: our-employees (Sales people, Research people, Management people)

In this case, if we want to query the Index 1 to Index 3, we can simply run our query by pointing to the “our-employees” alias.

Following some snippets of Elasticsearch alias actions

Adding Alias

POST /_aliases
{
   "actions": [
      {
         "add": {
            "index": "sales-people",
            "alias": "our-employees"
         }
      }
   ]
}

Removing Alias

POST /_aliases
{
   "actions": [
      {
         "remove": {
            "index": "sales-people",
            "alias": "our-employees"
         }
      }
   ]
}

Adding and Removing index in alias using the same call

POST /_aliases
{
   "actions": [
      {
         "remove": {
            "index": "sales-people",
            "alias": "our-employees"
         },
         "add": {
            "index": "research-people",
            "alias": "our-employees"
         }
      }
   ]
}

Happy exploring data 🙂

Steps to make Adobe Reader to remember last visited page number

I’m using Adobe Reader to read pdf files for very long time. Recently, I have installed Adobe Digital Edition to view some files. I’ve experienced that, Adobe Digital Edition is remembering the page number which I’ve visited before and is available by default.

Adobe Reader also having this feature, but we need to enable this if needed.

So, here is the steps:

  1. Goto Eidt  -> Preferences or Ctrl+K
  2. Under Documents Category, Enable the option “Restore last view settings when reopening documents
  3. Click OK

pdf restore page number.png

Happy Reading 🙂