I could be off base here, maybe using textTight as unique key is a common SOLR 
practice I don't know.  But, It would seem to me that using any field type that 
transforms a value (even if it is just whitespace removal) could be 
problematic.   Maybe not the source of your issue here, but I'd be worrying 
about collisions.  For instance what if you sent "xyz" as a key and "XYZ" as a 
key?  The doc would be overwritten.  You may end up with unexpected results 
when you get the record back...  Maybe with your use-case this is OK but have 
you considered using string instead?

Tim

-----Original Message-----
From: Christopher Baird [mailto:cba...@cardinalcommerce.com] 
Sent: Tuesday, September 01, 2009 7:30 AM
To: solr-user@lucene.apache.org
Subject: Adding new docs, but duplicating instead of updating

Hi All,

 

I'm running Solr in a multicore setup.  I've set one of the cores to have a
specific field as the unique key (marked as the uniqueKey in the document
and the field is defined as required).  I'm sending an <add> command with
all the docs using a multipart post.  After running the add file, I send
<commit/> and then send <optimize/>.  This works fine.  When I resend the
file (and commit and optimize), I double my document count and when I do a
query by unique key, I get two documents back.

 

I've confirmed using the admin UI that (schema browser) that my document
count has doubled.  I've also confirmed that unique key is the one I
specified (again, using schema browser).  The unique key field is marked as
type textTight.

 

Thanks for any help

 

-Chris

Reply via email to