code: protected void addReferenceValue(Document doc, String fieldName, Object internalValue)
     {
        String uuid = internalValue.toString();
        doc.add(createFieldWithoutNorms(fieldName, uuid, PropertyType.REFERENCE));
        doc.add(new Field(FieldNames.PROPERTIES, FieldNames.createNamedValue(fieldName, uuid), Field.Store.YES,
           Field.Index.NO, Field.TermVector.NO));
     }
docs: Adds the reference value to the document as the named field. The value's
  string representation is added as the reference data. Additionally the
  reference data is stored in the index.
  
  @param doc           The document to which to add the field
  @param fieldName     The name of the field to add
  @param internalValue The value for the field to add to the document.