code: protected Field createIndexField(String key, Object value) {
          if (key == null || value == null) {
              return null;
          }
          if (value instanceof Boolean) {
              return new IntPoint(key, ((Boolean) value).booleanValue() ? 1 : 0);
          }
          if (value instanceof Character) {
              return new StringField(key, value.toString(), Store.NO);
          }
          if (value instanceof Byte || value instanceof Short || value instanceof Integer
                  || value instanceof Long) {
              Number v = (Number) value;
              return new LongPoint(key, v.longValue());
          }
          if (value instanceof Float || value instanceof Double) {
              Number v = (Number) value;
              return new DoublePoint(key, v.doubleValue());
          }
          if (value instanceof Date) {
              return new StringField(key, DateFormatUtils.toString((Date) value, DATETIME_FORMAT),
                      Store.NO);
          }
          if (value instanceof String) {
              String v = value.toString().trim();
              return v.indexOf(' ') >= 0 ? new TextField(key, v, Store.NO)
                      : new StringField(key, v, Store.NO);
          }
          return null;
      }
docs: Create index field for a document's field value.
  
  <ul>
  <li>Boolean: indexed as a {@link IntPoint} with value {@code 1=true/0=false}</li>
  <li>Character: indexed as a {@link StringField}</li>
  <li>Byte, Short, Integer, Long: indexed as a {@link LongPoint}</li>
  <li>Float, Double: indexed as a {@link DoublePoint}</li>
  <li>String: indexed as a {@link StringField} if value contains no space, {@link TextField}
  otherwise</li>
  <li>Date: indexed as a {@link StringField}, {@code Date} is converted to {@code String} with
  format {@link #DATETIME_FORMAT}.</li>
  </ul>
  
  @param key
  @param value
  @return