Exemplo n.º 1
0
 /**
  * This method will always add these fields to the solr index:
  *
  * <ul>
  *   <li>id
  *   <li>tags
  *   <li>type
  * </ul>
  *
  * It will also try to add the keywords list and name properties if they exist.
  *
  * @param resource
  * @param additionalFields
  * @throws Exception
  */
 public void add(final AbstractEntity resource, final Map<String, Object> additionalFields) {
   addField("id", resource.getId());
   addField("tags", resource.getTags());
   addTypeField(resource);
   maybeAddNamedProperty("keywords", resource);
   maybeAddNamedProperty("name", resource);
   if (additionalFields != null) {
     for (Map.Entry<String, Object> entry : additionalFields.entrySet()) {
       addField(entry.getKey(), entry.getValue());
     }
   }
 }