Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

percolator registered on an alias is never triggered #3147

Closed
iksnalybok opened this issue Jun 6, 2013 · 3 comments
Closed

percolator registered on an alias is never triggered #3147

iksnalybok opened this issue Jun 6, 2013 · 3 comments

Comments

@iksnalybok
Copy link
Contributor

Actually, adding a percolator is always successful, regardless whether the targeted index exists or not. Currently, the targeted index should be a real index, and cannot be an alias. I don't know if this is the wanted behavior, but it's confused me; the percolate documentation is silent about this use case.

To reproduce:

# Create an index (idx), and an alias pointing to it (idxAlias).
curl -XPUT localhost:9200/idx
curl -XPOST localhost:9200/_aliases -d ' { "actions" : [ { "add" : { "index" : "idx", "alias" : "idxAlias" } } ] }'

# Create a percolator on the index it-self.
# Percolating a document via the index or the alias works in both cases. This is fine.
curl -XPUT localhost:9200/_percolator/idx/kuku -d '{ "query" : { "term" : { "field1" : "value1" } } }'
curl -XGET localhost:9200/idx/type1/_percolate -d '{ "doc" : { "field1" : "value1" } }'
    ~> {"ok":true,"matches":["kuku"]}
curl -XGET localhost:9200/idxAlias/type1/_percolate -d '{ "doc" : { "field1" : "value1" } }'
    ~> {"ok":true,"matches":["kuku"]}

# Create a percolator on the alias.
# Percolating a document via the index or the alias fails in both cases.
curl -XPUT localhost:9200/_percolator/idxAlias/kiki -d '{ "query" : { "term" : { "field2" : "value2" } } }'
    ~> {"ok":true,"_index":"_percolator","_type":"idxAlias","_id":"kiki","_version":1}
curl -XGET localhost:9200/idx/type1/_percolate -d '{ "doc" : { "field2" : "value2" } }'
    ~> {"ok":true,"matches":[]}
curl -XGET localhost:9200/idxAlias/type1/_percolate -d '{ "doc" : { "field2" : "value2" } }'
    ~> {"ok":true,"matches":[]}
@julianhille
Copy link

This is a very heavy issue for me, cause im relying on percolator and aliases.

  • Percolators will be created with the name of the alias as a type.
  • Percolators querying will be with the real index name.

@martijnvg
Copy link
Member

The percolate api just doesn't support resolving aliases. The redesigned percolate api does support resolving aliases to concrete indices.

@martijnvg
Copy link
Member

Now fully supported via #3420

martijnvg pushed a commit that referenced this issue Apr 25, 2018
This commit adds a bulk action for apply translog operations in bulk to
an index. This action is then used in the persistent task for CCR to
apply shard changes from a leader shard.

Relates #3147
jasontedor added a commit to jasontedor/elasticsearch that referenced this issue May 11, 2018
This commit adds a bulk action for apply translog operations in bulk to
an index. This action is then used in the persistent task for CCR to
apply shard changes from a leader shard.

Relates elastic#3147
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants