[ 
https://issues.apache.org/jira/browse/SOLR-6304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14349298#comment-14349298
 ] 

Bryan Bende commented on SOLR-6304:
-----------------------------------

Is there a way to send multiple JSON documents in a single request?

The comments of JsonRecordReader for the splitPath say:

   *                   ... Any fields collected in the
   *                  parent tag or above will also be included in the record, 
but these are
   *                  not cleared after emitting the record.
   *                  <p/>
   *                  It uses the ' | ' syntax of PATH to pass in multiple 
paths.

So if you took the example from the blog post with the exams data, and sent two 
json documents with different first and last names, and split on /exams, then 
the first document gets added correctly, but the second document gets two 
values for first name since it is not cleared after the first record.

I would imagine there is some way to do this with the correct split path, but 
can't figure it out.

> Transforming and Indexing custom JSON data
> ------------------------------------------
>
>                 Key: SOLR-6304
>                 URL: https://issues.apache.org/jira/browse/SOLR-6304
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Noble Paul
>            Assignee: Noble Paul
>             Fix For: 4.10, Trunk
>
>         Attachments: SOLR-6304.patch, SOLR-6304.patch
>
>
> example
> {noformat}
> curl 
> localhost:8983/update/json/docs?split=/batters/batter&f=recipeId:/id&f=recipeType:/type&f=id:/batters/batter/id&f=type:/batters/batter/type
>  -d '
> {
>               "id": "0001",
>               "type": "donut",
>               "name": "Cake",
>               "ppu": 0.55,
>               "batters": {
>                               "batter":
>                                       [
>                                               { "id": "1001", "type": 
> "Regular" },
>                                               { "id": "1002", "type": 
> "Chocolate" },
>                                               { "id": "1003", "type": 
> "Blueberry" },
>                                               { "id": "1004", "type": 
> "Devil's Food" }
>                                       ]
>                       }
> }'
> {noformat}
> should produce the following output docs
> {noformat}
> { "recipeId":"001", "recipeType":"donut", "id":"1001", "type":"Regular" }
> { "recipeId":"001", "recipeType":"donut", "id":"1002", "type":"Chocolate" }
> { "recipeId":"001", "recipeType":"donut", "id":"1003", "type":"Blueberry" }
> { "recipeId":"001", "recipeType":"donut", "id":"1004", "type":"Devil's food" }
> {noformat}
> the split param is the element in the tree where it should be split into 
> multiple docs. The 'f' are field name mappings



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to