Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

Improved documentation, thanks Benson!

Erick Erickson8cf0735393db
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index e33fce8cde3..721c953bd62 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -616,6 +616,9 @@ Bug Fixes
* SOLR-4266: HttpSolrServer does not release connection properly on exception
when no response parser is used. (Steve Molloy via Mark Miller)
+* SOLR-2298: Updated JavaDoc for SolrDocument.addField and SolrInputDocument.addField
+ to have more information on name and value parameters. (Siva Natarajan)
+
Other Changes
----------------------
diff --git a/solr/solrj/src/java/org/apache/solr/common/SolrDocument.java b/solr/solrj/src/java/org/apache/solr/common/SolrDocument.java
index 1a7c9a8dd67..eae68355b77 100644
--- a/solr/solrj/src/java/org/apache/solr/common/SolrDocument.java
+++ b/solr/solrj/src/java/org/apache/solr/common/SolrDocument.java
@@ -108,7 +108,13 @@ public class SolrDocument implements Map<String,Object>, Iterable<Map.Entry<Stri
/**
* This will add a field to the document. If fields already exist with this
* name it will append value to the collection. If the value is Collection,
- * each value will be added independently.
+ * each value will be added independently.
+ *
+ * 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.
+ *
+ * @param name Name of the field, should match one of the field names defined under "fields" tag in schema.xml.
+ * @param value Value of the field, should be of same class type as defined by "type" attribute of the corresponding field in schema.xml.
*/
@SuppressWarnings("unchecked")
public void addField(String name, Object value)
diff --git a/solr/solrj/src/java/org/apache/solr/common/SolrInputDocument.java b/solr/solrj/src/java/org/apache/solr/common/SolrInputDocument.java
index a6049562c3e..78aa5301aff 100644
--- a/solr/solrj/src/java/org/apache/solr/common/SolrInputDocument.java
+++ b/solr/solrj/src/java/org/apache/solr/common/SolrInputDocument.java
@@ -63,9 +63,12 @@ public class SolrInputDocument implements Map<String,SolrInputField>, Iterable<S
/**
* 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.
+ *
+ * @param name Name of the field, should match one of the field names defined under "fields" tag in schema.xml.
+ * @param value Value of the field, should be of same class type as defined by "type" attribute of the corresponding field in schema.xml.
* @see #addField(String, Object, float)
- * @param name name of the field to add
- * @param value value of the field
*/
public void addField(String name, Object value)
{
@@ -132,8 +135,11 @@ public class SolrInputDocument implements Map<String,SolrInputField>, Iterable<S
* field, with the new boost. If the value is a collection, then each of its
* values will be added to the field.
*
- * @param name Name of the field to add
- * @param value Value of the field
+ * 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.
+ *
+ * @param name Name of the field, should match one of the field names defined under "fields" tag in schema.xml.
+ * @param value Value of the field, should be of same class type as defined by "type" attribute of the corresponding field in schema.xml.
* @param boost Boost value for the field
*/
public void addField(String name, Object value, float boost )