I suppose you are looking for functionality introduced at 7.5
https://issues.apache.org/jira/browse/SOLR-12361 which I call named
children.
Before 7.5 it was only single anonymous children list/dimension:
SID.addChildDocuments().
Do you really need to distinguish children between a few lists (named
fields) at 6.6?


On Tue, Apr 11, 2023 at 4:57 AM Charlie Hubbard <[email protected]>
wrote:

> Hi,
>
> I'm not sure what you mean by "naming children" exactly.  I don't have a
> stack trace, but this video discusses nested documents, and refers to
> enhanced support in 6.x so I know 6.x supports nested documents.
>
> https://youtu.be/qV0fIg-LGBE?t=446
>
> Here is what is in the Solr 8 manual:
>
> >
> >    - Even though child documents are provided as field values
> >    syntactically and with SolrJ, it’s a matter of syntax and it isn’t an
> >    actual field in the schema. Consequently, the field need not be
> defined in
> >    the schema and probably shouldn’t be as it would be confusing. There
> is no
> >    child document field type, at least not yet.
> >
> > And in the Solr 6.6 manual:
>
> > Nested documents may be indexed via either the XML or JSON data syntax
> (or
> > using SolrJ)
> > <https://solr.apache.org/guide/6_6/using-solrj.html#using-solrj>
>
>
> However, no such example using SolrJ is included, leading me to look to
> other versions that document the feature better.  Solr 6.6 manual does
> refer to the special field in JSON indexing `_childDocuments_`.  It's not
> until Solr 8.7 manual does it provide an example of using Solrj to index
> nested child documents.
>
> https://solr.apache.org/guide/8_7/indexing-nested-documents.html
>
> The first example using SolrJ simply sets a field with a List of
> SolrInputDocuments which is what I'm doing.  The 2nd uses a method on
> SolrInputDocument.addChildDocuments(Collection<SolrInputDocument>).  I see
> that method available on SolrJ for 6.x so I'm assuming that is supported.
> I'm just curious if someone knows if the first method should be supported
> or not?
>
> Charlie
>
> On Mon, Apr 10, 2023 at 3:36 PM Mikhail Khludnev <[email protected]> wrote:
>
> > Hello Charlie.
> > My (just) guess is that the old version might not support naming
> children,
> > unless you can prove it.
> > If you share stacktrace with method names and line numbers it might give
> a
> > clue regarding support for this functionality.
> >
> > On Mon, Apr 10, 2023 at 7:12 PM Charlie Hubbard <
> [email protected]
> > >
> > wrote:
> >
> > > Hi
> > >
> > > I'm encountering the following error when indexing a parent and nested
> > > children documents.  I'm using managed schemas, Solr 6.6.6, and Solrj
> to
> > > send the documents up to Solr for indexing.  I have the default
> `_root_`
> > > field defined in the schema, and the parent document can be indexed
> > without
> > > issue.  It's when I include the field `pages` that Solr complains.
> > >
> > > 1040R.pdf was rejected by the server for Error from server at
> > > http://localhost:8983/solr/mycollection: ERROR:
> > > [doc=08464756-4ecd-4758-b8cc-9575d8a922ce] multiple values encountered
> > for
> > > non multiValued field pages: [SolrInputDocument(fields:
> > >
> > > Here is the structure I'm trying to upload (this is
> > > psuedocode/JSON-ish representation to help represent data, their data
> > > types, and structure.  This is NOT literally what I'm sending).
> > >
> > > SolrInputDocument {
> > >    id: '08464756-4ecd-4758-b8cc-9575d8a922ce',
> > >    archiveDate_dt: "2023-04-08T12:23:43Z",
> > >    _batchId: 251
> > >    _type: "document",
> > >    ....
> > >    *pages*: [
> > >       SolrInputDocument {
> > >          id: "1c482d15-6dd2-4bb2-8583-59231aa8db9b",
> > >          archiveDate_dt: "2023-04-08T12:23:43Z",
> > >          _batchId: 251
> > >          _pageNumber: 1,
> > >          _type: "page",
> > >          content: "lorem ipsum dolor...."
> > >       },
> > >       SolrInputDocument {
> > >          ...
> > >        },
> > >        ...
> > >    ]
> > > }
> > >
> > > It clearly doesn't like the field `pages` which isn't defined in the
> > > schema, but reading the various documents from Solr seems like it
> doesn't
> > > need to be?  That Solr should recognize the nested documents contained
> > > within the embedded List and know what to do.  Do I have that right?
> I'm
> > > piecing together information from several versions of Solr because the
> > > 6.6.6 docs are pretty sparse about how things work, and later versions
> > do a
> > > better job explaining it.
> > >
> > > What am I doing wrong?
> > >
> > > Thanks in advance
> > > Charlie
> > >
> >
> >
> > --
> > Sincerely yours
> > Mikhail Khludnev
> > https://t.me/MUST_SEARCH
> > A caveat: Cyrillic!
> >
>


-- 
Sincerely yours
Mikhail Khludnev
https://t.me/MUST_SEARCH
A caveat: Cyrillic!

Reply via email to