Ejemplo n.º 1
0
 public static String getValueFromField(SearchInputDocument doc, String fieldName) {
   SearchInputField field = doc.getField(fieldName);
   if (field == null) {
     return "UNKNOWN";
   } else {
     Object value = field.getFirstValue();
     return (value == null) ? "UNKNOWN" : String.valueOf(value);
   }
 }
Ejemplo n.º 2
0
  private static StringBuilder format(SearchInputField field, String padding) {
    StringBuilder sb = new StringBuilder();
    sb.append(padding)
        .append(
            "SearchInputField: Name='"
                + field.getName()
                + "', boost='"
                + field.getBoost()
                + "', "
                + field.getValues().size()
                + " values \n");

    for (Object value : field.getValues()) {
      sb.append(padding).append("   '").append(String.valueOf(value)).append("' \n");
    }
    return sb;
  }