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

Shalin Shekhar Mangar commented on SOLR-6304:
---------------------------------------------

I like this. We should try to standardize this across CSV and XML formats too 
(but don't let that stop you).

Initially I thought that we could do f.id.map=/batters/batter/id instead of 
f=id:/batters/batter/id but then that'd mean that not specifying field names 
would not be possible. In the current syntax, one can just write 
f=:/batters/batter/id and the field name can automatically be inferred as id if 
required.

> Add a way to flatten an input JSON to multiple docs
> ---------------------------------------------------
>
>                 Key: SOLR-6304
>                 URL: https://issues.apache.org/jira/browse/SOLR-6304
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Noble Paul
>            Assignee: Noble Paul
>
> 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.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to