>From what I can tell from this email and without looking at the RDRH patch, it 
>sound slike RDRH patch assumes that unique document ID field is called "id".

The unique doc field is defined in schema.xml.  For example in 
example/solr/conf/schema.xml we have:

 <!-- Field to use to determine and enforce document uniqueness. 
      Unless this field is marked with required="false", it will be a required 
field
   -->
 <uniqueKey>id</uniqueKey>

And we also have:

<field name="id" type="string" indexed="true" stored="true" required="true" />


Note it's of type "string".

Otis
--
Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch


----- Original Message ----
> From: Chris Harris <[EMAIL PROTECTED]>
> To: solr-dev@lucene.apache.org
> Sent: Tuesday, May 13, 2008 4:39:42 PM
> Subject: ID field in RichDocumentRequestHandler (SOLR-284)
> 
> As you probably know, the RichDocumentRequestHandler (SOLR-284) will
> index documents from a few different formats. You specify the document
> body in the HTTP POST request stream, the name of the Solr field where
> you wish to store the document body in the URL, and you can also
> specify (again in the URL) field name/field value pairs for other
> fields you want to be indexed along with the body.
> 
> What I just noticed is that one particular field name, "id", gets
> special treatment, and I'm wondering if it actually needs special
> treatment.
> 
> Currently, the handler requires a field named "id", and requires that
> it be an integer. The ID field is a special case when fields are being
> added to the document builder; the general case code looks like this:
> 
>   for (int i =0; i < fields.length;i++){
>     String fieldName = fields[i].getName();
>     String[] values = params.getParams(fieldName);
>     for(String value : values) {
>         builder.addField(fieldName,value,1.0f);
>     }
>   }
> 
> while the ID-specific code looks like this:
> 
>   builder.addField("id", id + "", 1.0f);
> 
> Outside of this field-adding code, though, the id field doesn't seem
> to be treated differently from any other field. I'm guessing that the
> id parameter is meant provide a unique key for the document you're
> indexing. Is there any reason to hard-code the name of that field,
> though, or to require it to be an integer? Maybe I would like to call
> my unique key field "key", for instance, and have its datatype be
> text.
> 
> Hopefully I am being coherent.
> 
> Chris

Reply via email to