fixing scaling images -> nullpointer, patch by yossarian
[mir.git] / source / mircoders / search / ContentSearchTerm.java
index 636d1ec..2e52ebd 100755 (executable)
@@ -40,7 +40,10 @@ import mir.entity.Entity;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
 
-
+/**
+ * Tokenizes a string field in an Entity and indexes
+ * it, but does not store it for retrieval (used for content_data) 
+ */
 public class ContentSearchTerm extends SearchTerm{
   protected ContentSearchTerm() {
   }
@@ -54,7 +57,7 @@ public class ContentSearchTerm extends SearchTerm{
   }
 
   public void index(Document doc, Entity entity){
-    doc.add(Field.UnStored(matchField,entity.getValue(partOfEntity)));
+    doc.add(Field.UnStored(matchField,entity.getFieldValue(partOfEntity)));
   }
 
   public void indexValue(Document doc, String value){
@@ -91,9 +94,7 @@ public class ContentSearchTerm extends SearchTerm{
           }
         }
       }
-      else {
-        return null;
-      }
+                       return null;
   }
 
   public void returnMeta(Map result,Document doc){