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 CrazyDiamond <Cr...@mail.ru> on 2015/11/18 23:35:51 UTC
adding document with nested document require to set id
i'm trying to add document with the nested objects but don't want id to be
generated automatically.
When i add document without nesting it's ok.But if i add _childDocuments_
there is an error [doc=null] missing required field: id
--
View this message in context: http://lucene.472066.n3.nabble.com/adding-document-with-nested-document-require-to-set-id-tp4240908.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: adding document with nested document require to set id
Posted by Mikhail Khludnev <mk...@griddynamics.com>.
It should be explained http://wiki.apache.org/solr/UpdateRequestProcessor
On Thu, Nov 19, 2015 at 9:27 PM, CrazyDiamond <Cr...@mail.ru> wrote:
> How to do this?
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/adding-document-with-nested-document-require-to-set-id-tp4240908p4241091.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
--
Sincerely yours
Mikhail Khludnev
Principal Engineer,
Grid Dynamics
<http://www.griddynamics.com>
<mk...@griddynamics.com>
Re: adding document with nested document require to set id
Posted by CrazyDiamond <Cr...@mail.ru>.
How to do this?
--
View this message in context: http://lucene.472066.n3.nabble.com/adding-document-with-nested-document-require-to-set-id-tp4240908p4241091.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: adding document with nested document require to set id
Posted by Mikhail Khludnev <mk...@griddynamics.com>.
Hi,
Perhaps you want UUIDUpdateProcessorFactory loop through
SolrInputDocument.getChildDocuments() and assign generated value. You need
to implement an own update processor (by extending one of existing).
On Thu, Nov 19, 2015 at 7:41 PM, CrazyDiamond <Cr...@mail.ru> wrote:
> How exactly you are doing that?
> Doing what?
> <field name="id" type="uuid" indexed="true" stored="true"
> required="true"
> />
> this is from schema.
> <updateRequestProcessorChain name="uuid">
> <processor class="solr.UUIDUpdateProcessorFactory">
> <str name="fieldName">id</str>
> </processor>
> ...
> <updateRequestProcessorChain name="add-unknown-fields-to-the-schema">
> <processor class="solr.UUIDUpdateProcessorFactory" />
>
> this is from config
> i want to store in nested document multiple values that should be grouped
> together, like pages ids and pages urls
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/adding-document-with-nested-document-require-to-set-id-tp4240908p4241058.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
--
Sincerely yours
Mikhail Khludnev
Principal Engineer,
Grid Dynamics
<http://www.griddynamics.com>
<mk...@griddynamics.com>
Re: adding document with nested document require to set id
Posted by CrazyDiamond <Cr...@mail.ru>.
How exactly you are doing that?
Doing what?
<field name="id" type="uuid" indexed="true" stored="true" required="true"
/>
this is from schema.
<updateRequestProcessorChain name="uuid">
<processor class="solr.UUIDUpdateProcessorFactory">
<str name="fieldName">id</str>
</processor>
...
<updateRequestProcessorChain name="add-unknown-fields-to-the-schema">
<processor class="solr.UUIDUpdateProcessorFactory" />
this is from config
i want to store in nested document multiple values that should be grouped
together, like pages ids and pages urls
--
View this message in context: http://lucene.472066.n3.nabble.com/adding-document-with-nested-document-require-to-set-id-tp4240908p4241058.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: adding document with nested document require to set id
Posted by Mikhail Khludnev <mk...@griddynamics.com>.
Hello,
On Thu, Nov 19, 2015 at 12:48 PM, CrazyDiamond <Cr...@mail.ru>
wrote:
> id is generated automatically(i use
> uuid)
>
How exactly you are doing that?
i tryed to add nesting. i want
> the same behaviour for nested documents as it was for not nested.
>
How exactly you want it to work with them?
--
Sincerely yours
Mikhail Khludnev
Principal Engineer,
Grid Dynamics
<http://www.griddynamics.com>
<mk...@griddynamics.com>
Re: adding document with nested document require to set id
Posted by CrazyDiamond <Cr...@mail.ru>.
if i add document without nesting then id is generated automatically(i use
uuid), and this was working perfectly until i tryed to add nesting. i want
the same behaviour for nested documents as it was for not nested.
--
View this message in context: http://lucene.472066.n3.nabble.com/adding-document-with-nested-document-require-to-set-id-tp4240908p4240979.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: adding document with nested document require to set id
Posted by Alexandre Rafalovitch <ar...@gmail.com>.
If you have id listed as a required field (which I believe you need to
anyway), what do you actually get when you add a document without
nesting? What does the document echo back?
Because if you are getting a document back without id field when it is
declared required in the schema, that would be a problem of its own.
Regards,
Alex.
----
Newsletter and resources for Solr beginners and intermediates:
http://www.solr-start.com/
On 18 November 2015 at 17:35, CrazyDiamond <Cr...@mail.ru> wrote:
> i'm trying to add document with the nested objects but don't want id to be
> generated automatically.
> When i add document without nesting it's ok.But if i add _childDocuments_
> there is an error [doc=null] missing required field: id
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/adding-document-with-nested-document-require-to-set-id-tp4240908.html
> Sent from the Solr - User mailing list archive at Nabble.com.