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

Easily view nested structured data in Discover #5459

Closed
michaelruigrok opened this issue Nov 10, 2023 · 4 comments
Closed

Easily view nested structured data in Discover #5459

michaelruigrok opened this issue Nov 10, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@michaelruigrok
Copy link

michaelruigrok commented Nov 10, 2023

Let's say I have a nested object that I want to compare between records. If a record has a lot of data, the values you might not be able to see a field in the in-line list view, meaning you have to use the 'Inspect document details' pop-out view (as highlighted in Amoo-Miki's comment below). This sidebar view only allows you to see the structure of one document/row at a time, which makes quickly comparing values between rows very painful.

I propose having a column option that lets you toggle a column to display a full multi-line pretty JSON version of a field. This would let you quickly compare each record's value for a nested object without needing to click each row to open an alternative view.

Here's a rough mock-up
image

I believe this is a critical feature for exploring the possible fields of dynamic records. Since you don't know what specific fields exist, being able to drill down in a structured way helps find seldom-used fields and build understanding of how fields relate to one another.

Additional Suggestions

Another benefit of the JSON view is making it easy to display arrays of objects. If you have object.array.obj.obj.value, and a column for object.obj.obj.value, the column could simply map the object.array accordingly and display the result as a JSON array .

for instance consider a document containing the following data:

    "items": [
      {
        "create": {
          "error": {
            "type": "mapper_parsing_exception",
            "reason": "failed to parse field [params] of type [flat_object] in document with id '3f_aDY8BcM9u71R9O4jG'. Preview of field's value: 'null'",
            "caused_by": {
              "reason": "String index out of range: -6",
              "type": "string_index_out_of_bounds_exception"
            }
          },
          "_index": "index-1",
          "_id": "3f_aDY8BcM9u71R9O4jG",
          "status": 400
        }
      },
     {
        "create": {
          "_index": "index-1",
          "_id": "WLBEDY8BnusCfASEi3d8",
          "status": 400,
          "error": {
            "reason": "some other error",
            "type": "mapper_parsing_exception"
          }
        }
      },
      {
        "create": {
          "status": 201,
          "_index": "index-1",
          "_id": "3v_aDY8BcM9u71R9O4jG",
          "_version": 1,
          "result": "created",
          "_primary_term": 4,
          "_shards": {
            "successful": 2,
            "failed": 0,
            "total": 2
          },
          "_seq_no": 1216245
        }
      }
      ]

A JSON column in the document display showing the value items.create.error could display the following:

[
{
	"type": "mapper_parsing_exception",
	"reason": "failed to parse field [params] of type [flat_object] in document with id '3f_aDY8BcM9u71R9O4jG'. Preview of field's value: 'null'",
	"caused_by": {
		"reason": "String index out of range: -6",
		"type": "string_index_out_of_bounds_exception"
	}
},
{
	"reason": "some other error",
	"type": "mapper_parsing_exception"
},
null
]
@michaelruigrok michaelruigrok added the enhancement New feature or request label Nov 10, 2023
@AMoo-Miki
Copy link
Collaborator

The JSON view is still available on the new Discover experience. Have you tried the button next to each row to see if that fulfills your needs?

@AMoo-Miki
Copy link
Collaborator

There is also a PR to enhance the fields that are available on the left-menu: #5429.

@AMoo-Miki
Copy link
Collaborator

If neither of those options are what you were looking for, please add some details of your vision and reopen this issue.

@michaelruigrok
Copy link
Author

@AMoo-Miki I have clarified the description of this issue. I am aware of the existing JSON view present in new Discover, I believe this is insufficient for the kind of quick structural comparison it needs to support. My request is to display specific JSON in each row to quickly compare dozens of rows without having to click open the full JSON view. Please let me know if my description is not clear enough.

Could you please re-open this issue? it appears I lack the permissions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants