Error importing JSONL in a DataStorage

Hello, im trying to make a Custom Reserch App, then create a new Datastore>Cloud Storage then checking Structured Data Import**-**JSONL with document ID and then selecting my .jsonl file, it always gives this error during importing

invalid JSON in google.cloud.discoveryengine.v1main.Document @ jsonData: string, near 1:50 (offset 49): unexpected character: ‘{’; expected ‘"’

but my jsonl structure looks fine
{“id”:“”,“jsonData”:{“ship_code”:“”,“shipowner_descri”:“”,“ship_descri”:“”,“ship_ownercode”:“”,“ship_imocode”:“”}}
someone faced the same problem?

Hello @Daniele_Russo1,

I think that you should replace with " in your jsonl.

Hi @LeoK thank you for your reply, i dont have this format in my code, just here on the forum is shown this way, this is how it appears on my code:

still didnt solve the problem

@Daniele_Russo1,

I think that this page about Preparing Data with Cloud Storage for a Search App may interest you.

From what I’m seeing, jsonData should be a JSON string.

Example:

{"id":"doc-0","jsonData":"{\"title\":\"test_doc_0\",\"description\":\"This document uses a blue color theme\",\"color_theme\":\"blue\"}","content":{"mimeType":"application/pdf","uri":"gs://test-bucket-12345678/test_doc_0.pdf"}}

Hope this helps!

I successfully imported using structData, looks like is required the field “title”

image

i didnt try your version but i guess it works, thanks a lot.

My bad for not being more specific, using StructData was indeed the right choice here! Glad it’s fixed :slightly_smiling_face: