lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From abhi Abhishek <abhi26...@gmail.com>
Subject Re: Error:Missing Required Fields for Atomic Updates
Date Tue, 20 Nov 2018 07:57:52 GMT
Update Handler expect all the required fields to be passed in even for the
atomic update request payload.

https://github.com/apache/lucene-solr/blob/branch_7_5/solr/core/src/java/org/apache/solr/update/DocumentBuilder.java

Hope this helps!

// Now validate required fields or add default values // fields with
default values are defacto 'required' // Note: We don't need to add default
fields if this document is to be used for // in-place updates, since this
validation and population of default fields would've happened // during the
full indexing initially. if (!forInPlaceUpdate) { for (SchemaField field :
schema.getRequiredFields()) { if (out.getField(field.getName() ) == null) {
if (field.getDefaultValue() != null) { addField(out, field,
field.getDefaultValue(), false); } else { String msg = getID(doc, schema) +
"missing required field: " + field.getName(); throw new SolrException(
SolrException.ErrorCode.BAD_REQUEST, msg ); } } } } Cheers! Abhishek

On Tue, Nov 20, 2018 at 11:47 AM Rahul Goswami <rahul196452@gmail.com>
wrote:

> What is the Router name for your collection? Is it "implicit"  (You can
> know this from the "Overview" of you collection in the admin UI)  ? If yes,
> what is the router.field parameter the collection was created with?
>
> Rahul
>
>
> On Mon, Nov 19, 2018 at 11:19 PM Rajeswari Kolluri <
> rajeswari.kolluri@oracle.com> wrote:
>
> >
> > Hi Rahul
> >
> > Below is part of schema ,   entityid is my unique id field.  Getting
> > exception missing required field for  "category"  during atomic updates.
> >
> >
> > <uniqueKey>entityid</uniqueKey>
> > <field name="entityid" type="string" indexed="true" stored="true"
> > required="true" multiValued="false" />
> >     <field name="name" type="text_general" indexed="true" stored="true"
> > required="false" multiValued="false" />
> >     <field name="description" type="text_general" indexed="true"
> > stored="true" required="false" multiValued="false" />
> >     <field name="vendorName" type="text_general" indexed="true"
> > stored="true" required="false" multiValued="false" />
> >     <field name="modelNumber" type="text_general" indexed="true"
> > stored="true" required="false" multiValued="false" />
> >     <field name="partNumber" type="text_general" indexed="true"
> > stored="true" required="false" multiValued="false" />
> >     <field name="serialNumber" type="text_general" indexed="true"
> > stored="true" required="false" multiValued="false" />
> >     <field name="category" type="string" indexed="true" stored="false"
> > required="true" docValues="true" />
> >     <field name="place" type="text_general" indexed="true" stored="true"
> > required="false" multiValued="true" />
> >
> >
> >
> > Thanks
> > Rajeswari
> >
> > -----Original Message-----
> > From: Rahul Goswami [mailto:rahul196452@gmail.com]
> > Sent: Tuesday, November 20, 2018 9:33 AM
> > To: solr-user@lucene.apache.org
> > Subject: Re: Error:Missing Required Fields for Atomic Updates
> >
> > What’s your update query?
> >
> > You need to provide the unique id field of the document you are updating.
> >
> > Rahul
> >
> > On Mon, Nov 19, 2018 at 10:58 PM Rajeswari Kolluri <
> > rajeswari.kolluri@oracle.com> wrote:
> >
> > > Hi,
> > >
> > >
> > >
> > >
> > >
> > > Using Solr 7.5.0.  While performing atomic updates on a document  on
> > > Solr Cloud using SolJ  getting exceptions "Missing Required Field".
> > >
> > >
> > >
> > > Please let me know  the solution, would not want to update the
> > > required fields during atomic updates.
> > >
> > >
> > >
> > >
> > >
> > > Thanks
> > >
> > > Rajeswari
> > >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message