fix #6354 non phrase search with wildcard using the standart QueryParser
[cdmlib.git] / cdmlib-services / src / main / java / eu / etaxonomy / cdm / api / service / search / SearchResult.java
index dae4981026f5e7ebff2c93ae2386115a0d0e891a..d644b58ccc6354139fceb5a8f72a76949f08c690 100644 (file)
@@ -1,4 +1,3 @@
-// $Id$
 /**
 * Copyright (C) 2012 EDIT
 * European Distributed Institute of Taxonomy
@@ -9,13 +8,6 @@
 */
 package eu.etaxonomy.cdm.api.service.search;
 
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.lucene.document.Document;
-import org.hibernate.search.engine.DocumentBuilder;
-
 import eu.etaxonomy.cdm.model.common.CdmBase;
 
 /**
@@ -25,44 +17,10 @@ import eu.etaxonomy.cdm.model.common.CdmBase;
  * @date Jan 6, 2012
  *
  */
-public class SearchResult<T extends CdmBase> {
-
-    private float score = 0;
-
-    private float maxScore = 0;
-
-    private final String ID_FIELD = "id";
-
-    /**
-     * key will be a combination of DocumentBuilder.CLASS_FIELDNAME and id field: ID_FIELD
-     */
-    private Map<String, Document> docs = new HashMap<String, Document>();
-
+public class SearchResult<T extends CdmBase> extends DocumentSearchResult {
 
     private T entity;
 
-    private Map<String,String[]> fieldHighlightMap;
-
-
-    public double getScore() {
-        return score;
-    }
-
-
-    public void setScore(float score) {
-        this.score = score;
-    }
-
-    @Deprecated
-    public Document getDoc() {
-        return docs.values().iterator().next();
-    }
-
-    @Deprecated
-    public void setDoc(Document doc) {
-        addDoc(doc);
-    }
-
     public T getEntity() {
         return entity;
     }
@@ -71,50 +29,7 @@ public class SearchResult<T extends CdmBase> {
         this.entity = entity;
     }
 
-    public Map<String,String[]> getFieldHighlightMap() {
-        return fieldHighlightMap;
-    }
-
-    public void setFieldHighlightMap(Map<String,String[]> fieldHighlightMap) {
-        this.fieldHighlightMap = fieldHighlightMap;
-    }
-
-    /**
-     * @param doc
-     * @param entity
-     */
-    public SearchResult(Document doc) {
-        addDoc(doc);
-    }
-
     public SearchResult() {
     }
 
-
-    public float getMaxScore() {
-        return maxScore;
-    }
-
-
-    public void setMaxScore(float maxScore) {
-        this.maxScore = maxScore;
-    }
-
-
-    public Collection<Document> getDocs() {
-        return docs.values();
-    }
-
-
-    public void addDoc(Document doc) {
-        String key = doc.getValues(DocumentBuilder.CLASS_FIELDNAME)[0] + "." + doc.getValues(ID_FIELD)[0];
-        this.docs.put(key, doc);
-    }
-
-
-
-
-
-
-
 }