One difficulty is that the documentation of SolrInputDocument.addField(String, Object) is not at all specific. I'm aware of SOLR-2298 and I accept that the patch is an improvement, but still...
@param value Value of the field, should be of same class type as
defined by "type" attribute of the corresponding field in
schema.xml.
The corresponding <field/>'s 'type' attribute is an arbitrary label
referencing the 'name' attribute of a <fieldType/>. It could be
"boysenberry" or "axolotl". So we need to look at the 'class'
attribute of the fieldType? So, if I have in my schema:
<fieldType name='date' class='solr.DatePointField' bla bla/>
<field name='created' type='date' bla bla/>
then I need to pass an instance of DatePointField?
myDoc.addField("created", new DatePointField(bla bla));
That doesn't seem right, but go ahead and surprise me.
But I *know* that it accepts a properly formatted String value for a
field using DatePointField. So, how can I determine the set of Java
types that is accepted as a new field value for a field whose field
type's class attribute is X? And where should I have read that?
--
Mark H. Wood
Lead Technology Analyst
University Library
Indiana University - Purdue University Indianapolis
755 W. Michigan Street
Indianapolis, IN 46202
317-274-0749
www.ulib.iupui.edu
signature.asc
Description: PGP signature
