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

Regresion in 7.8.0 lucene query "_exists_:non_existing_field_in_mapping" "Rewrite first" exception #58737

Closed
ypid-geberit opened this issue Jun 30, 2020 · 1 comment · Fixed by #58804
Labels
>bug :Search/Search Search-related issues that do not fall into other categories Team:Search Meta label for search team

Comments

@ypid-geberit
Copy link

ypid-geberit commented Jun 30, 2020

Elasticsearch version (bin/elasticsearch --version):

Version: 7.8.0, Build: default/rpm/757314695644ea9a1dc2fecd26d1a43856725e65/2020-06-14T19:35:50.234439Z, JVM: 11.0.7

Plugins installed: []

None.

JVM version (java -version):

openjdk version "11.0.7" 2020-04-14
OpenJDK Runtime Environment (build 11.0.7+10-suse-3.42.4-x8664)
OpenJDK 64-Bit Server VM (build 11.0.7+10-suse-3.42.4-x8664, mixed mode)

OS version (uname -a if on a Unix-like system):

Linux xxx 4.12.14-197.45-default #1 SMP Thu Jun 4 11:06:04 UTC 2020 (2b6c749) x86_64 x86_64 x86_64 GNU/Linux

Description of the problem including expected versus actual behavior:

Querying using the query string query for _exists_:non_existing_field_in_mapping results in an exception. Up until ES 7.7, it just said no search hits.

Steps to reproduce:

  1. curl "http://localhost:9200/test/_doc" -XPOST -H 'Content-Type: application/yaml' -d '{"test": 23}'`
  2. curl "http://localhost:9200/test/_search" -H 'Content-Type: application/yaml' -d '
    query:
      query_string:
        query: "_exists_:test_something"
    '

Provide logs (if relevant):

---
error:
  root_cause:
  - type: "query_shard_exception"
    reason: "failed to create query: Rewrite first"
    index_uuid: "nxucOP6VSl6JKLZ0mYt7wQ"
    index: "test"
  type: "search_phase_execution_exception"
  reason: "all shards failed"
  phase: "query"
  grouped: true
  failed_shards:
  - shard: 0
    index: "test"
    node: "mr1vscKBTwCFEJ4W885sKg"
    reason:
      type: "query_shard_exception"
      reason: "failed to create query: Rewrite first"
      index_uuid: "nxucOP6VSl6JKLZ0mYt7wQ"
      index: "test"
      caused_by:
        type: "illegal_state_exception"
        reason: "Rewrite first"
status: 400
@ypid-geberit ypid-geberit added >bug needs:triage Requires assignment of a team area label labels Jun 30, 2020
@jimczi jimczi added :Search/Search Search-related issues that do not fall into other categories and removed needs:triage Requires assignment of a team area label labels Jul 1, 2020
@elasticmachine
Copy link
Collaborator

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

@elasticmachine elasticmachine added the Team:Search Meta label for search team label Jul 1, 2020
jimczi added a commit to jimczi/elasticsearch that referenced this issue Jul 1, 2020
Since elastic#55785, exists queries rewrite to MatchNoneQueryBuilder when the field is unmapped.
This change also introduced a bug in the `query_string` query, using an unmapped field
like `_exists_:foo` throws an exception if the field is unmapped. This commit avoids the
exception if the query is built outside of an `ExistsQueryBuilder`.

Closes elastic#58737
jimczi added a commit that referenced this issue Jul 2, 2020
Since #55785, exists queries rewrite to MatchNoneQueryBuilder when the field is unmapped.
This change also introduced a bug in the `query_string` query, using an unmapped field
like `_exists_:foo` throws an exception if the field is unmapped. This commit avoids the
exception if the query is built outside of an `ExistsQueryBuilder`.

Closes #58737
jimczi added a commit that referenced this issue Jul 2, 2020
Since #55785, exists queries rewrite to MatchNoneQueryBuilder when the field is unmapped.
This change also introduced a bug in the `query_string` query, using an unmapped field
like `_exists_:foo` throws an exception if the field is unmapped. This commit avoids the
exception if the query is built outside of an `ExistsQueryBuilder`.

Closes #58737
jimczi added a commit that referenced this issue Jul 2, 2020
Since #55785, exists queries rewrite to MatchNoneQueryBuilder when the field is unmapped.
This change also introduced a bug in the `query_string` query, using an unmapped field
like `_exists_:foo` throws an exception if the field is unmapped. This commit avoids the
exception if the query is built outside of an `ExistsQueryBuilder`.

Closes #58737
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 Team:Search Meta label for search team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants