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: Fix handling of nested documents #6540
Labels
Comments
brwe
added a commit
to brwe/elasticsearch
that referenced
this issue
Jun 18, 2014
Nested documents were indexed as separate documents, but it was never checked if the hits represent nested documents or not. Therefore, nested objects could match not nested queries and nested queries could also match not nested documents. Examples are in issue elastic#6540 . closes elastic#6540
spinscale
changed the title
Percolator nested documents error
Percolator: Fix handling of nested documents
Jun 18, 2014
mute
pushed a commit
to mute/elasticsearch
that referenced
this issue
Jul 29, 2015
Nested documents were indexed as separate documents, but it was never checked if the hits represent nested documents or not. Therefore, nested objects could match not nested queries and nested queries could also match not nested documents. Examples are in issue elastic#6540 . closes elastic#6540 closes elastic#6544
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The percolator appears to have some strange matching behavior with nested objects defined in the document mapping. Steps to reproduce:
curl -XDELETE localhost:9200/test
curl -XPUT localhost:9200/test -d '{
"settings": {
"index.number_of_shards": 1,
"index.number_of_replicas": 0
},
"mappings": {
"doc": {
"properties": {
"persons": {
"type": "nested"
}
}
}
}
}'
curl -XPUT localhost:9200/test/.percolator/1 -d '{
"query": {
"bool": {
"must": {
"match": {
"name": "obama"
}
}
}
}
}'
curl -XPUT localhost:9200/test/.percolator/2 -d '{
"query": {
"bool": {
"must_not": {
"match": {
"name": "obama"
}
}
}
}
}'
curl -XPUT localhost:9200/test/.percolator/3 -d '{
"query": {
"bool": {
"must": {
"match": {
"persons.foo": "bar"
}
}
}
}
}'
curl -XPUT localhost:9200/test/.percolator/4 -d '{
"query": {
"bool": {
"must_not": {
"match": {
"persons.foo": "bar"
}
}
}
}
}'
curl -XPUT localhost:9200/test/.percolator/5 -d '{
"query": {
"bool": {
"must": {
"nested": {
"path": "persons",
"query": {
"match": {
"persons.foo": "bar"
}
}
}
}
}
}
}'
curl -XPUT localhost:9200/test/.percolator/6 -d '{
"query": {
"bool": {
"must_not": {
"nested": {
"path": "persons",
"query": {
"match": {
"persons.foo": "bar"
}
}
}
}
}
}
}'
curl -XPOST localhost:9200/_refresh
Thi should only match 1 and 5, but instead it matches 1,2,3,4,5,6
curl -XPOST localhost:9200/test/doc/_percolate?pretty -d '{
"doc": {
"name": "obama",
"persons": [
{
"foo": "bar"
}
]
}
}'
The text was updated successfully, but these errors were encountered: