lucene-solr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hoss Man (JIRA)" <>
Subject [jira] Commented: (SOLR-1695) Missleading error message when adding docs with missing/multiple value(s) for uniqueKey field
Date Thu, 18 Feb 2010 19:50:28 GMT


Hoss Man commented on SOLR-1695:

Hmmm.... ok so the reason the legacy test passed prior to this change is that DirectUpdateHandler2
(and DirectUpdateHandler from what i can tell) don't bother checking for a uniqueKey (or for
multiple uniqueKeys) if allowDups="true" (which it is in the line of ConvertedLEgacyTest that's

So the question becomes: Is it a bug that DUH(2) allow docs w/o a uniqueKey field just because

If it's not a bug, then this entire patch should probably be rolled back -- but personally
It feels like it really is a bug: if a schema declares a uniqueKey field, then just because
a particular add command says allowDups=true doesn't mean that docs w/o an id (or with multiple
ids) should be allowed in to the index -- those docs will need meaningful ids if/when a later
commit does want to override them (consider the case of doing an initial build w/ allowDups=true
for speed, and then incremental updates w/ allowDups=false ... the index needs to be internally

Actually: I'm just going to roll this entire patch back either way -- we can improve the error
messages generated by DirectUpdateHandler2 and eliminate the redundant uniqueKey check in
DocumentBuilder.toDocument.  As a separate issue we can consider whether DUH2 is buggy.

>  Missleading error message when adding docs with missing/multiple value(s) for uniqueKey
> ----------------------------------------------------------------------------------------------
>                 Key: SOLR-1695
>                 URL:
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Hoss Man
>            Assignee: Hoss Man
>            Priority: Minor
>             Fix For: 1.5
> Sometimes users don't seem to notice/understand the <uniqueKey/> declaration in
the example schema, and the error message they get if their documents don't include that field
is confusing...
> {code}
> org.apache.solr.common.SolrException: Document [null] missing required field: id
> {code}
> ...because they get an almost identical error even if they remove {{required=true}} from
{{<field name="id" />}} in their schema.xml file.
> We should improve the error message so it's clear when a Document is missing the "uniqueKeyField"
(not just a "required" field) so they know the terminology to look for in diagnosing the problem.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message