Package org.apache.solr.schema

Examples of org.apache.solr.schema.FieldType.toObject()


        Object val;
        if (ft==null) {  // handle fields not in the schema
          if (f.isBinary()) val = f.binaryValue();
          else val = f.stringValue();
        } else {
          val = useFieldObjects ? ft.toObject(f) : ft.toExternal(f);
        }
        solrDoc.addField(fieldName, val);
      }
      return solrDoc;
    }
View Full Code Here


          // concatenate all the values for multi-valued field
          Fieldable[] fields = solrDoc.getFieldables(fieldName);
          if (fields != null && fields.length > 0) {
            ArrayList<String> valueList = new ArrayList<String>();
            for (Fieldable fd : fields) {
              Object fieldObj = fieldType.toObject(fd);
              if (fieldObj != null)
                valueList.add(fieldObj.toString());
            }
            fieldValue = StringUtil.listToString(valueList, ",");
          }
View Full Code Here

        } else {
          // single valued field
          Fieldable field = solrDoc.getFieldable(fieldName);
          if (field != null) {
            Object fieldObj = fieldType.toObject(field);
            if (fieldObj != null)
              fieldValue = fieldObj.toString();
          }
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.