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 Chris Hostetter <ho...@fucit.org> on 2008/04/02 01:30:25 UTC

Re: Multiple unique field?

: I want to set 2 field that are unique for different kind of searching. Does
: it possible?

not unless you enforce it yourself -- there isn't anything built in to 
Solr to do this with the exception of the uniqueKey field.

There is an UpdateRequestProcessorFactory hook that you can implement to 
do arbitrary logic for each update command (regardless of wether the 
update comes from XML, CSV, or something else) ... you could add whatever 
uniqueness logic you want there.



-Hoss


Re: Multiple unique field?

Posted by Chris Hostetter <ho...@fucit.org>.
: When I set 2 unique key field, it looks like Solr only accept the first
: definition in schema.xml...question: so once the unique Key defined, it
: can't be overrided?

there is one and only one uniqueKey field ... trying to declare two should 
probably be an error 9anyone wnat to submit a patch?), but you definitley 
can't "override" the uniqueKey field ... declare it once, and that's what 
it is for your whole index.


-Hoss


Re: Multiple unique field?

Posted by Vinci <vi...@polyu.edu.hk>.
Hi,

Thank you for your reply.
When I set 2 unique key field, it looks like Solr only accept the first
definition in schema.xml...question: so once the unique Key defined, it
can't be overrided?

Thank you,
Vinci


ryantxu wrote:
> 
>>
>> Thank you for your reply
>> In other word, can I set 2 unique key field?
> 
> directly in solr: no
> 
> In your own code, yes -- either in the client or in custom plugin.
> 
> ryan
> 
> 

-- 
View this message in context: http://www.nabble.com/Multiple-unique-field--tp16367339p16465798.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Multiple unique field?

Posted by Ryan McKinley <ry...@gmail.com>.
>
> Thank you for your reply
> In other word, can I set 2 unique key field?

directly in solr: no

In your own code, yes -- either in the client or in custom plugin.

ryan

Re: Multiple unique field?

Posted by Vinci <vi...@polyu.edu.hk>.
Hi,

Thank you for your reply
In other word, can I set 2 unique key field?

Thank you,
Vinci


hossman wrote:
> 
> 
> : I want to set 2 field that are unique for different kind of searching.
> Does
> : it possible?
> 
> not unless you enforce it yourself -- there isn't anything built in to 
> Solr to do this with the exception of the uniqueKey field.
> 
> There is an UpdateRequestProcessorFactory hook that you can implement to 
> do arbitrary logic for each update command (regardless of wether the 
> update comes from XML, CSV, or something else) ... you could add whatever 
> uniqueness logic you want there.
> 
> 
> 
> -Hoss
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Multiple-unique-field--tp16367339p16441192.html
Sent from the Solr - User mailing list archive at Nabble.com.