code: @Override
      public String indexValue(String name, Object value) {
          if (value == null) {
              return null;
          } else if (value instanceof InetAddress) {
              InetAddress inetAddress = (InetAddress) value;
              return inetAddress.getHostAddress();
          } else if (value instanceof String) {
              String svalue = (String) value;
              if (IPV4_PATTERN.matcher(svalue).matches() ||
                  IPV6_PATTERN.matcher(svalue).matches() ||
                  IPV6_COMPRESSED_PATTERN.matcher(svalue).matches()) {
                  try {
                      return InetAddress.getByName(svalue).getHostAddress();
                  } catch (UnknownHostException e) {
                      Log.error(e, e.getMessage());
                  }
              }
          }
          throw new IllegalArgumentException(String.format("Value '%s' cannot be cast to InetAddress", value));
      }
docs: {@inheritDoc}