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

Join field called "_type" is duplicated in the _search results #110438

Open
AlexeySagin opened this issue Jul 3, 2024 · 6 comments
Open

Join field called "_type" is duplicated in the _search results #110438

AlexeySagin opened this issue Jul 3, 2024 · 6 comments
Assignees
Labels
>bug priority:normal A label for assessing bug priority to be used by ES engineers :Search Foundations/Search Catch all for Search Foundations :StorageEngine/Logs You know, for Logs Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch Team:StorageEngine v8.14.0

Comments

@AlexeySagin
Copy link

Elasticsearch Version

8.14.1

Installed Plugins

No response

Java Version

bundled

OS Version

Linux 5.19.0-2-amd64 #1 SMP PREEMPT_DYNAMIC Debian 5.19.11-1 (2022-09-24) x86_64 GNU/Linux

Problem Description

If join field called _type it's duplicated in _search request results.
Problem appears at 8.14 release.
8.9; 8.12; 8.13 is ok.

Steps to Reproduce

  1. make index and docs as example in documentation for join field type:
    https://www.elastic.co/guide/en/elasticsearch/reference/8.14/parent-join.html

  2. make search curl 'localhost:9200/my-index-000001/_search?pretty'
    got resutl like:

{
     "_index" : "my-index-000001",
     "_id" : "4",
     "_score" : 1.0,
     "_routing" : "1",
     "_source" : {
       "my_id" : "4",
       "text" : "This is another answer",
       "my_join_field" : {
         "name" : "answer",
         "parent" : "1"
       }
     }
   }
  1. reproduce steps 1 and 2, but rename index name from my-index-000001 to my-index-000002 and join field my_join_field to _type

  2. make search curl 'localhost:9200/my-index-000002/_search?pretty'

{
        "_index" : "my-index-000002",
        "_id" : "4",
        "_score" : 1.0,
        "_routing" : "1",
        "_type" : {
          "name" : "answer",
          "parent" : "1"
        },
        "_source" : {
          "my_id" : "4",
          "text" : "This is another answer",
          "_type" : {
            "name" : "answer",
            "parent" : "1"
          }
        }
      }

result: _type field is duplicated inside and outside _source
expected: _type field present only inside _source

Logs (if relevant)

No response

@AlexeySagin AlexeySagin added >bug needs:triage Requires assignment of a team area label labels Jul 3, 2024
@gwbrown gwbrown 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 3, 2024
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine elasticsearchmachine added the Team:Search Meta label for search team label Jul 3, 2024
@benwtrent benwtrent added :StorageEngine/Logs You know, for Logs Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch labels Jul 9, 2024
@elasticsearchmachine elasticsearchmachine added Team:StorageEngine and removed Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch labels Jul 9, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-storage-engine (Team:StorageEngine)

@benwtrent
Copy link
Member

This is most likely caused by how we now fetch metadata fields (of which the ancient _type field is one), separately from regular fields.

#106325

@benwtrent benwtrent added v8.14.0 priority:normal A label for assessing bug priority to be used by ES engineers labels Jul 9, 2024
@javanna javanna added :Search Foundations/Search Catch all for Search Foundations and removed :Search/Search Search-related issues that do not fall into other categories labels Jul 17, 2024
@elasticsearchmachine elasticsearchmachine added Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch and removed Team:Search Meta label for search team labels Jul 17, 2024
@elasticsearchmachine
Copy link
Collaborator

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

@AlexeySagin
Copy link
Author

There are another issue with _type field. See issue and my comment at:
#107209 (comment)

@AlexeySagin
Copy link
Author

@benwtrent @gwbrown @salvatore-campagna
Any update here?
We are using "_type" key and this is critical for project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug priority:normal A label for assessing bug priority to be used by ES engineers :Search Foundations/Search Catch all for Search Foundations :StorageEngine/Logs You know, for Logs Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch Team:StorageEngine v8.14.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants