Your unique key field should be of type "string" not a tokenized type. 

   Erik

On May 18, 2012, at 17:50, "Parmeley, Michael" <mjparme...@west.com> wrote:

> I have a uniquekey set in my schema; however, I am still getting duplicated 
> documents added. Can anyone provide any insight into why this may be 
> happening?
> 
> This is in my schema.xml:
> 
> <!-- Field to use to determine and enforce document uniqueness.
>      Unless this field is marked with required="false", it will be a required 
> field
>   -->
> <uniqueKey>uniquekey</uniqueKey>
> 
>   <field name="uniquekey" type="text_general" indexed="true" stored="true" 
> required="true" />
> 
> On startup I get this message in catalina.out:
> 
> INFO: unique key field: uniquekey
> 
> However, you can see I get multiple documents:
> 
> <result name="response" numFound="7" start="0">
> <doc>
> <str name="abbreviation">PSR3</str>
> <int name="clientid">1</int>
> <str name="entitytype">Skill</str>
> <int name="id">510</int>
> <str name="name">Body and Soul</str>
> <int name="projectid">1</int>
> <int name="skillnumber">281</int>
> <str name="uniquekey">Skill510</str>
> </doc>
> <doc>
> <str name="abbreviation">PSR3</str>
> <int name="clientid">1</int>
> <str name="entitytype">Skill</str>
> <int name="id">510</int>
> <str name="name">Body and Soul</str>
> <int name="projectid">1</int>
> <int name="skillnumber">281</int>
> <str name="uniquekey">Skill510</str>
> </doc>
> <doc>
> <str name="abbreviation">PSR3</str>
> <int name="clientid">1</int>
> <str name="entitytype">Skill</str>
> <int name="id">510</int>
> <str name="name">Body and Soul</str>
> <int name="projectid">1</int>
> <int name="skillnumber">281</int>
> <str name="uniquekey">Skill510</str>
> </doc>
> <doc>
> <str name="abbreviation">PSR3</str>
> <int name="clientid">1</int>
> <str name="entitytype">Skill</str>
> <int name="id">510</int>
> <str name="name">Body and Soul</str>
> <int name="projectid">1</int>
> <int name="skillnumber">281</int>
> <str name="uniquekey">Skill510</str>
> </doc>
> <doc>
> <str name="abbreviation">PSR3</str>
> <int name="clientid">1</int>
> <str name="entitytype">Skill</str>
> <int name="id">510</int>
> <str name="name">Body and Soul</str>
> <int name="projectid">1</int>
> <int name="skillnumber">281</int>
> <str name="uniquekey">Skill510</str>
> </doc>
> <doc>
> <str name="abbreviation">PSR3</str>
> <int name="clientid">1</int>
> <str name="entitytype">Skill</str>
> <int name="id">510</int>
> <str name="name">Body and Soul</str>
> <int name="projectid">1</int>
> <int name="skillnumber">281</int>
> <str name="uniquekey">Skill510</str>
> </doc>
> <doc>
> <str name="abbreviation">PSR3</str>
> <int name="clientid">1</int>
> <str name="entitytype">Skill</str>
> <int name="id">510</int>
> <str name="name">Body and Soul</str>
> <int name="projectid">1</int>
> <int name="skillnumber">281</int>
> <str name="uniquekey">Skill510</str>
> </doc>
> </result>

Reply via email to