Solr missing mandatory uniqueKey field: id or Unknown field

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Solr missing mandatory uniqueKey field: id or Unknown field

Sthitaprajna

I am using solr 8.1.1

Created core/collection. Then after update schema & solrconfig i am getting these errors.

Before adding id field to schema.xml









After adding id field on schema.xml



Here are my schema.xml & solrconfig.xml, what is wrong i am doing ?

schema.xml :

<?xml version="1.0" encoding="UTF-8" ?>
<schema name="dict" version="1.6">
<field name="title" type="string" stored="true" indexed="true" required="true" multiValued="false"/>
<field name="_version_" type="long" indexed="true" stored="true"/>
<field name="id" type="string"/>
<copyField source="title" dest="id"  />
<uniqueKey>title</uniqueKey>
<fieldType name="string" class="solr.StrField"/>
<fieldType name="long" class="solr.TrieLongField" precisionStep="0" positionIncrementGap="0"/>
<fieldType name="int" class="solr.TrieIntField" precisionStep="0" positionIncrementGap="0"/>
</schema>
solrconfig:
<?xml version="1.0" encoding="UTF-8"?>

<config>
  <luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>  

  <updateHandler class="solr.DirectUpdateHandler2">

    <updateLog>
          <str name="dir">${solr.ulog.dir:}</str>
              </updateLog>

     <autoCommit> 
            <maxTime>${solr.autoCommit.maxTime:15000}</maxTime> 
                   <openSearcher>false</openSearcher> 
                        </autoCommit>

     <autoSoftCommit> 
            <maxTime>${solr.autoSoftCommit.maxTime:-1}</maxTime> 
                 </autoSoftCommit>
                   </updateHandler>

  <requestHandler name="/select" class="solr.SearchHandler"></requestHandler>

  <requestHandler name="/admin/ping" class="solr.PingRequestHandler">

  <lst name="invariants">
  <str name="qt">/select</str><!-- handler to delegate to -->
  <str name="q">title:*</str>
  </lst>
  <str name="healthcheckFile">server-enabled.txt</str>
  </requestHandler>

  <requestHandler name="/update" class="solr.UpdateRequestHandler" />

  <requestHandler name="/replication" class="solr.ReplicationHandler" startup="lazy" />

  <requestHandler name="/get" class="solr.RealTimeGetHandler">
        <lst name="defaults">
                <str name="omitHeader">true</str>
                     </lst>
                           </config>




Reply | Threaded
Open this post in threaded view
|

Re: Solr missing mandatory uniqueKey field: id or Unknown field

Erick Erickson
Attachments are aggressively stripped by the mail server, so I can’t see them.

Possibilities
- you didn’t reload your core/collection
- you didn’t push the configset to Zookeeper if using SolrCloud
- you are using the managed schema, which uses a file called “managed-schema” rather than classic, which uses schema.xml
- your input doesn’t really have a field “title”.
- the doc just doesn’t have a field called “title” in it when it’s sent to Solr.


Best,
Erick

> On Nov 8, 2019, at 4:41 AM, Sthitaprajna <[hidden email]> wrote:
>
> title

Reply | Threaded
Open this post in threaded view
|

Re: Solr missing mandatory uniqueKey field: id or Unknown field

Sthitaprajna
Thanks,

I did reload after solr configuration upload to zk
Yes i push the config set to zk and i can see all my changes are on cloud
I turned off the managed schema
Yes it has, ypu could have seen it if the attachment are available. I have attached again may be it will be available.

On Fri, 8 Nov 2019, 21:13 Erick Erickson, <[hidden email]> wrote:
Attachments are aggressively stripped by the mail server, so I can’t see them.

Possibilities
- you didn’t reload your core/collection
- you didn’t push the configset to Zookeeper if using SolrCloud
- you are using the managed schema, which uses a file called “managed-schema” rather than classic, which uses schema.xml
- your input doesn’t really have a field “title”.
- the doc just doesn’t have a field called “title” in it when it’s sent to Solr.


Best,
Erick

> On Nov 8, 2019, at 4:41 AM, Sthitaprajna <[hidden email]> wrote:
>
> title

Reply | Threaded
Open this post in threaded view
|

Re: Solr missing mandatory uniqueKey field: id or Unknown field

Alexandre Rafalovitch
Something does not make sense, because your schema defines "title" as
the uniqueKey field, but your message talks about "id". Are you
absolutely sure that the Solr/collection you get an error for is the
same Solr where you are checking the schema?

Also, do you have a bit more of the error and stack trace. I find
"...or Unknown field" to be very puzzling. What are you trying to do
when you get this error?

Regards,
  Alex.

On Sat, 9 Nov 2019 at 01:05, Sthitaprajna <[hidden email]> wrote:

>
> Thanks,
>
> I did reload after solr configuration upload to zk
> Yes i push the config set to zk and i can see all my changes are on cloud
> I turned off the managed schema
> Yes it has, ypu could have seen it if the attachment are available. I have attached again may be it will be available.
>
> On Fri, 8 Nov 2019, 21:13 Erick Erickson, <[hidden email]> wrote:
>>
>> Attachments are aggressively stripped by the mail server, so I can’t see them.
>>
>> Possibilities
>> - you didn’t reload your core/collection
>> - you didn’t push the configset to Zookeeper if using SolrCloud
>> - you are using the managed schema, which uses a file called “managed-schema” rather than classic, which uses schema.xml
>> - your input doesn’t really have a field “title”.
>> - the doc just doesn’t have a field called “title” in it when it’s sent to Solr.
>>
>>
>> Best,
>> Erick
>>
>> > On Nov 8, 2019, at 4:41 AM, Sthitaprajna <[hidden email]> wrote:
>> >
>> > title
>>
Reply | Threaded
Open this post in threaded view
|

Re: Solr missing mandatory uniqueKey field: id or Unknown field

Sthitaprajna
https://stackoverflow.com/questions/58763657/solr-missing-mandatory-uniquekey-field-id-or-unknown-field?noredirect=1#comment103816164_58763657

May be this will help ? I added screenshots.

On Fri, 8 Nov 2019, 22:57 Alexandre Rafalovitch, <[hidden email]> wrote:

> Something does not make sense, because your schema defines "title" as
> the uniqueKey field, but your message talks about "id". Are you
> absolutely sure that the Solr/collection you get an error for is the
> same Solr where you are checking the schema?
>
> Also, do you have a bit more of the error and stack trace. I find
> "...or Unknown field" to be very puzzling. What are you trying to do
> when you get this error?
>
> Regards,
>   Alex.
>
> On Sat, 9 Nov 2019 at 01:05, Sthitaprajna <[hidden email]>
> wrote:
> >
> > Thanks,
> >
> > I did reload after solr configuration upload to zk
> > Yes i push the config set to zk and i can see all my changes are on cloud
> > I turned off the managed schema
> > Yes it has, ypu could have seen it if the attachment are available. I
> have attached again may be it will be available.
> >
> > On Fri, 8 Nov 2019, 21:13 Erick Erickson, <[hidden email]>
> wrote:
> >>
> >> Attachments are aggressively stripped by the mail server, so I can’t
> see them.
> >>
> >> Possibilities
> >> - you didn’t reload your core/collection
> >> - you didn’t push the configset to Zookeeper if using SolrCloud
> >> - you are using the managed schema, which uses a file called
> “managed-schema” rather than classic, which uses schema.xml
> >> - your input doesn’t really have a field “title”.
> >> - the doc just doesn’t have a field called “title” in it when it’s sent
> to Solr.
> >>
> >>
> >> Best,
> >> Erick
> >>
> >> > On Nov 8, 2019, at 4:41 AM, Sthitaprajna <
> [hidden email]> wrote:
> >> >
> >> > title
> >>
>
Reply | Threaded
Open this post in threaded view
|

Re: Solr missing mandatory uniqueKey field: id or Unknown field

Alexandre Rafalovitch
You still have a mismatch between what you think the schema is
(uniqueKey=title) and message of uniqueKey being id. Focus on that. Try to
get schema FROM Solr instead og looking at one you are providing. Or look
in Admin UI what it shows for field title and for field id.

Regards,
    Alex

On Mon, Nov 11, 2019, 2:30 PM Sthitaprajna, <[hidden email]>
wrote:

>
> https://stackoverflow.com/questions/58763657/solr-missing-mandatory-uniquekey-field-id-or-unknown-field?noredirect=1#comment103816164_58763657
>
> May be this will help ? I added screenshots.
>
> On Fri, 8 Nov 2019, 22:57 Alexandre Rafalovitch, <[hidden email]>
> wrote:
>
> > Something does not make sense, because your schema defines "title" as
> > the uniqueKey field, but your message talks about "id". Are you
> > absolutely sure that the Solr/collection you get an error for is the
> > same Solr where you are checking the schema?
> >
> > Also, do you have a bit more of the error and stack trace. I find
> > "...or Unknown field" to be very puzzling. What are you trying to do
> > when you get this error?
> >
> > Regards,
> >   Alex.
> >
> > On Sat, 9 Nov 2019 at 01:05, Sthitaprajna <[hidden email]
> >
> > wrote:
> > >
> > > Thanks,
> > >
> > > I did reload after solr configuration upload to zk
> > > Yes i push the config set to zk and i can see all my changes are on
> cloud
> > > I turned off the managed schema
> > > Yes it has, ypu could have seen it if the attachment are available. I
> > have attached again may be it will be available.
> > >
> > > On Fri, 8 Nov 2019, 21:13 Erick Erickson, <[hidden email]>
> > wrote:
> > >>
> > >> Attachments are aggressively stripped by the mail server, so I can’t
> > see them.
> > >>
> > >> Possibilities
> > >> - you didn’t reload your core/collection
> > >> - you didn’t push the configset to Zookeeper if using SolrCloud
> > >> - you are using the managed schema, which uses a file called
> > “managed-schema” rather than classic, which uses schema.xml
> > >> - your input doesn’t really have a field “title”.
> > >> - the doc just doesn’t have a field called “title” in it when it’s
> sent
> > to Solr.
> > >>
> > >>
> > >> Best,
> > >> Erick
> > >>
> > >> > On Nov 8, 2019, at 4:41 AM, Sthitaprajna <
> > [hidden email]> wrote:
> > >> >
> > >> > title
> > >>
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: Solr missing mandatory uniqueKey field: id or Unknown field

Paras Lehana
Hi Sthitaprajna,

In Admin UI, select core and go to Schema. Select "title" and post the
screenshot (try to host it). Do the same for "id".

On Mon, 11 Nov 2019 at 09:14, Alexandre Rafalovitch <[hidden email]>
wrote:

> You still have a mismatch between what you think the schema is
> (uniqueKey=title) and message of uniqueKey being id. Focus on that. Try to
> get schema FROM Solr instead og looking at one you are providing. Or look
> in Admin UI what it shows for field title and for field id.
>
> Regards,
>     Alex
>
> On Mon, Nov 11, 2019, 2:30 PM Sthitaprajna, <[hidden email]
> >
> wrote:
>
> >
> >
> https://stackoverflow.com/questions/58763657/solr-missing-mandatory-uniquekey-field-id-or-unknown-field?noredirect=1#comment103816164_58763657
> >
> > May be this will help ? I added screenshots.
> >
> > On Fri, 8 Nov 2019, 22:57 Alexandre Rafalovitch, <[hidden email]>
> > wrote:
> >
> > > Something does not make sense, because your schema defines "title" as
> > > the uniqueKey field, but your message talks about "id". Are you
> > > absolutely sure that the Solr/collection you get an error for is the
> > > same Solr where you are checking the schema?
> > >
> > > Also, do you have a bit more of the error and stack trace. I find
> > > "...or Unknown field" to be very puzzling. What are you trying to do
> > > when you get this error?
> > >
> > > Regards,
> > >   Alex.
> > >
> > > On Sat, 9 Nov 2019 at 01:05, Sthitaprajna <
> [hidden email]
> > >
> > > wrote:
> > > >
> > > > Thanks,
> > > >
> > > > I did reload after solr configuration upload to zk
> > > > Yes i push the config set to zk and i can see all my changes are on
> > cloud
> > > > I turned off the managed schema
> > > > Yes it has, ypu could have seen it if the attachment are available. I
> > > have attached again may be it will be available.
> > > >
> > > > On Fri, 8 Nov 2019, 21:13 Erick Erickson, <[hidden email]>
> > > wrote:
> > > >>
> > > >> Attachments are aggressively stripped by the mail server, so I can’t
> > > see them.
> > > >>
> > > >> Possibilities
> > > >> - you didn’t reload your core/collection
> > > >> - you didn’t push the configset to Zookeeper if using SolrCloud
> > > >> - you are using the managed schema, which uses a file called
> > > “managed-schema” rather than classic, which uses schema.xml
> > > >> - your input doesn’t really have a field “title”.
> > > >> - the doc just doesn’t have a field called “title” in it when it’s
> > sent
> > > to Solr.
> > > >>
> > > >>
> > > >> Best,
> > > >> Erick
> > > >>
> > > >> > On Nov 8, 2019, at 4:41 AM, Sthitaprajna <
> > > [hidden email]> wrote:
> > > >> >
> > > >> > title
> > > >>
> > >
> >
>


--
--
Regards,

*Paras Lehana* [65871]
Development Engineer, Auto-Suggest,
IndiaMART Intermesh Ltd.

8th Floor, Tower A, Advant-Navis Business Park, Sector 142,
Noida, UP, IN - 201303

Mob.: +91-9560911996
Work: 01203916600 | Extn:  *8173*

--
IMPORTANT: 
NEVER share your IndiaMART OTP/ Password with anyone.
Reply | Threaded
Open this post in threaded view
|

Re: Solr missing mandatory uniqueKey field: id or Unknown field

Sthitaprajna
Thanks paras, after your comment i realized/found it is using managed
schema.

After reading solr documentations
https://lucene.apache.org/solr/guide/6_6/schema-factory-definition-in-solrconfig.html
Added on solrconfig.xml , reloaded and it works thanks

<schemaFactory class="ClassicIndexSchemaFactory"/>

Thanks Erick Erickson & Alexandre Rafalovitch , you have also mentioned
same.

On Mon, Nov 11, 2019 at 2:28 PM Paras Lehana <[hidden email]>
wrote:

> Hi Sthitaprajna,
>
> In Admin UI, select core and go to Schema. Select "title" and post the
> screenshot (try to host it). Do the same for "id".
>
> On Mon, 11 Nov 2019 at 09:14, Alexandre Rafalovitch <[hidden email]>
> wrote:
>
> > You still have a mismatch between what you think the schema is
> > (uniqueKey=title) and message of uniqueKey being id. Focus on that. Try
> to
> > get schema FROM Solr instead og looking at one you are providing. Or look
> > in Admin UI what it shows for field title and for field id.
> >
> > Regards,
> >     Alex
> >
> > On Mon, Nov 11, 2019, 2:30 PM Sthitaprajna, <
> [hidden email]
> > >
> > wrote:
> >
> > >
> > >
> >
> https://stackoverflow.com/questions/58763657/solr-missing-mandatory-uniquekey-field-id-or-unknown-field?noredirect=1#comment103816164_58763657
> > >
> > > May be this will help ? I added screenshots.
> > >
> > > On Fri, 8 Nov 2019, 22:57 Alexandre Rafalovitch, <[hidden email]>
> > > wrote:
> > >
> > > > Something does not make sense, because your schema defines "title" as
> > > > the uniqueKey field, but your message talks about "id". Are you
> > > > absolutely sure that the Solr/collection you get an error for is the
> > > > same Solr where you are checking the schema?
> > > >
> > > > Also, do you have a bit more of the error and stack trace. I find
> > > > "...or Unknown field" to be very puzzling. What are you trying to do
> > > > when you get this error?
> > > >
> > > > Regards,
> > > >   Alex.
> > > >
> > > > On Sat, 9 Nov 2019 at 01:05, Sthitaprajna <
> > [hidden email]
> > > >
> > > > wrote:
> > > > >
> > > > > Thanks,
> > > > >
> > > > > I did reload after solr configuration upload to zk
> > > > > Yes i push the config set to zk and i can see all my changes are on
> > > cloud
> > > > > I turned off the managed schema
> > > > > Yes it has, ypu could have seen it if the attachment are
> available. I
> > > > have attached again may be it will be available.
> > > > >
> > > > > On Fri, 8 Nov 2019, 21:13 Erick Erickson, <[hidden email]
> >
> > > > wrote:
> > > > >>
> > > > >> Attachments are aggressively stripped by the mail server, so I
> can’t
> > > > see them.
> > > > >>
> > > > >> Possibilities
> > > > >> - you didn’t reload your core/collection
> > > > >> - you didn’t push the configset to Zookeeper if using SolrCloud
> > > > >> - you are using the managed schema, which uses a file called
> > > > “managed-schema” rather than classic, which uses schema.xml
> > > > >> - your input doesn’t really have a field “title”.
> > > > >> - the doc just doesn’t have a field called “title” in it when it’s
> > > sent
> > > > to Solr.
> > > > >>
> > > > >>
> > > > >> Best,
> > > > >> Erick
> > > > >>
> > > > >> > On Nov 8, 2019, at 4:41 AM, Sthitaprajna <
> > > > [hidden email]> wrote:
> > > > >> >
> > > > >> > title
> > > > >>
> > > >
> > >
> >
>
>
> --
> --
> Regards,
>
> *Paras Lehana* [65871]
> Development Engineer, Auto-Suggest,
> IndiaMART Intermesh Ltd.
>
> 8th Floor, Tower A, Advant-Navis Business Park, Sector 142,
> Noida, UP, IN - 201303
>
> Mob.: +91-9560911996
> Work: 01203916600 | Extn:  *8173*
>
> --
> IMPORTANT:
> NEVER share your IndiaMART OTP/ Password with anyone.
>


--

*Regards$th!t@*