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

‘exists’ query not working for nested docs with norms=false #80309

Closed
amatoba opened this issue Nov 3, 2021 · 3 comments
Closed

‘exists’ query not working for nested docs with norms=false #80309

amatoba opened this issue Nov 3, 2021 · 3 comments
Labels
>bug :Search/Search Search-related issues that do not fall into other categories

Comments

@amatoba
Copy link

amatoba commented Nov 3, 2021

Elasticsearch version (bin/elasticsearch --version): 7.15.1

Plugins installed: []

JVM version (java -version): 11.0.9

OS version (uname -a if on a Unix-like system): Darwin Kernel Version 20.6.0

Description of the problem including expected versus actual behavior:

For fields within nested docs with norms disabled, querying for their existence via 'exists' query appears to not be working. It does however work when norms are enabled. This works with 7.10.2, but no longer does in 7.14.1/7.15.1

Thanks for your help!

Steps to reproduce:
1.

curl -XPUT localhost:9200/test -d '{
	"mappings": {
		"properties": {
			"user": {
				"type": "nested",
				"properties": {
					"first": {
						"type": "text",
						"norms": false
					},
					"last": {
						"type": "text"
					}
				}
			}
		}
	}
}'
curl -XPUT localhost:9200/test/_doc/1 -d '{
  "user" : [
    {
      "first" : "John",
      "last" :  "Smith"
    }
  ]
}'
  1. Fails to find via user.first
curl -XGET localhost:9200/test/_search -d '{
	"query": {
		"nested": {
			"path": "user",
			"query": {
				"exists": {
					"field": "user.first"
				}
			}
		}
	}
}'
  1. Succeeds to find via user.last
curl -XGET localhost:9200/test/_search -d '{
	"query": {
		"nested": {
			"path": "user",
			"query": {
				"exists": {
					"field": "user.last"
				}
			}
		}
	}
}'

Provide logs (if relevant):

@amatoba amatoba added >bug needs:triage Requires assignment of a team area label labels Nov 3, 2021
@cbuescher cbuescher added the :Search/Search Search-related issues that do not fall into other categories label Nov 4, 2021
@elasticmachine elasticmachine added the Team:Search Meta label for search team label Nov 4, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (Team:Search)

@cbuescher cbuescher removed Team:Search Meta label for search team needs:triage Requires assignment of a team area label labels Nov 4, 2021
@romseygeek
Copy link
Contributor

Hi @amatoba, thanks for opening this! This was noticed before in #76362 and has been fixed by #78841, so I hope you don't mind that I close this as 'already fixed'.

@amatoba
Copy link
Author

amatoba commented Nov 4, 2021

Wonderful! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Search/Search Search-related issues that do not fall into other categories
Projects
None yet
Development

No branches or pull requests

4 participants