Hi,

the JavaDoc of SolrInputDocument.addField [1] states:
Add a field with implied null value for boost. The class type of value
and the name parameter should match schema.xml. schema.xml can be found
in conf directory under the solr home by default.

This sounds as if the value would need to be an instance of TextField,
TrieDateField and so on, which doesn't seem to make much sense. Looking
into the code it looks like the value is being interpreted in
org.apache.solr.client.solrj.util.ClientUtils.writeVal(..). This method
converts the passed in object into a string mainly by using the object's
toString() method. There is just special handling for Dates, byte arrays
and ByteBuffers. So this doesn't really seem to take a FieldType object.
All samples are also passing in simple String objects or other basic
objects like a Long. So what is expected here seems to be a string
representation that can be parsed by the analyzer of the FieldType as
defined in the schema.xml. Is that correct? Is there a page that shows
the supported formats for every standard type?

Beside that the first sentence is also a bit confusing as null can not
be passed into the other addField method and the version without the
boost value does actually invoke the one with a boost value set to 1.

regards,
Hendrik

[1]
http://lucene.apache.org/solr/5_3_0/solr-solrj/org/apache/solr/common/SolrInputDocument.html#addField%28java.lang.String,%20java.lang.Object%29

Reply via email to