You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Vishal Swaroop <vi...@gmail.com> on 2015/05/11 20:52:54 UTC

Help to index nested document

Need your valuable inputs...

I am indexing data from database (one table) which is in this example
format :
id name value
1 Joe 102724904
2 Joe 100996643

- id is primary/ unique key
- there can be same "name" but different "value"
- If I try "name" as unique key then SOLR removes duplicate and indexes 1
document

- I am getting the result in this format... Is there as way I can index
data in a way so that I can "value" can be child for "name"...
"response": {
    "numFound": 2,
    "start": 0,
    "docs": [
      {
        "id": "1",
        "name": "Joe",
        "value": [
          "102724904"
        ]
      },
      {
        "id": "2",
        "name": "Joe",
        "value": [
          "100996643"
        ]
      }...

Expected format :
    "docs": [
      {
        "name": "Joe",
        "value": [
          "102724904",
  "100996643"
        ]
      }

Re: Help to index nested document

Posted by Mikhail Khludnev <mk...@griddynamics.com>.
I'm absolutely sure that you need to group them externally in the indexer
eg like a child VALUES entity in DataImportHandler.

On Mon, May 11, 2015 at 9:52 PM, Vishal Swaroop <vi...@gmail.com>
wrote:

> Need your valuable inputs...
>
> I am indexing data from database (one table) which is in this example
> format :
> id name value
> 1 Joe 102724904
> 2 Joe 100996643
>
> - id is primary/ unique key
> - there can be same "name" but different "value"
> - If I try "name" as unique key then SOLR removes duplicate and indexes 1
> document
>
> - I am getting the result in this format... Is there as way I can index
> data in a way so that I can "value" can be child for "name"...
> "response": {
>     "numFound": 2,
>     "start": 0,
>     "docs": [
>       {
>         "id": "1",
>         "name": "Joe",
>         "value": [
>           "102724904"
>         ]
>       },
>       {
>         "id": "2",
>         "name": "Joe",
>         "value": [
>           "100996643"
>         ]
>       }...
>
> Expected format :
>     "docs": [
>       {
>         "name": "Joe",
>         "value": [
>           "102724904",
>   "100996643"
>         ]
>       }
>



-- 
Sincerely yours
Mikhail Khludnev
Principal Engineer,
Grid Dynamics

<http://www.griddynamics.com>
<mk...@griddynamics.com>