I did not use the Pecl package and the problem maybe about that. I want to
ask that when you define your schema you indicate that:

*required="true"*

However error says:

*allowDups*

for id field. So it seems that id is not a unique field for that package.
You may need to config anything else at that package or there maybe a bug
unrelated to Solr.



2013/9/7 Brian Robinson <br...@socialsurgemedia.com>

> Hello,
> I'm working with the Pecl package, with Solr 4.3.1. I have a doc defined
> in my schema where id is the uniqueKey,
>
> <field name="id" type="int" indexed="true" stored="true" required="true"
> multiValued="false" />
> <uniqueKey>id</uniqueKey>
>
> I tried to add a doc to my index with the following code (simplified for
> the question):
>
> $client = new SolrClient($options);
> $doc = new SolrInputDocument();
> $doc->addField('id', 12345);
> $doc->addField('description', 'This is the content of the doc');
> $updateResponse = $client->addDocument($doc);
>
> When I do this, the doc is not added to the index, and I get the following
> error in the logs in admin
>
>      Unknown attribute id in add:allowDups
>
> However, I noticed that if I change the field to type string:
>
> <field name="id" type="string" indexed="true" stored="true"
> required="true" multiValued="false" />
> ...
> $doc->addField('id', '12345');
>
> the doc is added to the index, but I still get the error in the log.
>
> So first, I was wondering, is there some other way I should be setting
> this up so that id can be an int instead of a string?
>
> And then I was also wondering what this error is referring to. Is there
> some further way I need to define id? Or maybe define the uniqueKey
> differently?
>
> Any help would be much appreciated.
> Thanks,
> Brian
>

Reply via email to