Skip to content

Not working with elasticsearch aliases #19

@llermaly

Description

@llermaly

Hi, I'm using filtered aliases to segment the data and they should work like indices , but for some reason are being ignored.

Go to Kibana Devtools and run the following:

DELETE test_animals

POST test_animals/_doc
{
  "name": "Peter Parker",
  "type": "dog"
}
POST test_animals/_doc
{
  "name": "Michael Jordan",
  "type": "cat"
}
POST _aliases 
{
  "actions": [
    {
      "add": {
        "index": "test_animals",
        "alias": "dogs",
        "filter": {
          "term": {
            "type.keyword": "dog"
          }
        }
      }
    },
    {
      "add": {
        "index": "test_animals",
        "alias": "cats",
        "filter": {
          "term": {
            "type.keyword": "cat"
          }
        }
      }
    }
  ]
}

This will generate two virtual indices based on one original indices, giving the the ability to run pdscan against segments of the data:

./pdscan elasticsearch+https://gustavo:gustavo@my-deployment-xxx:9200/cats --show-all --format ndjson --show-data
It should report only "michael jordan" but reports against all test_animals index.

Found 1 index to scan, sampling 10000 documents from each...

{"identifier":"test_animals.name","name":"surname","match_type":"value","confidence":"low","matches":["Michael Jordan","Peter Parker"],"matches_count":2}

Is this expected? how can I segment by a certain field?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions