3 * Copyright (C) 2012 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.cdm
.api
.service
.search
;
12 import java
.util
.Collection
;
13 import java
.util
.HashMap
;
16 import org
.apache
.lucene
.document
.Document
;
17 import org
.hibernate
.search
.engine
.ProjectionConstants
;
20 * TODO class description
22 * @author Andreas Kohlbecker
26 public class DocumentSearchResult
{
28 private float score
= 0;
30 private float maxScore
= 0;
33 public DocumentSearchResult() {
37 * key will be a combination of DocumentBuilder.CLASS_FIELDNAME and id field: ID_FIELD
39 private final Map
<String
, Document
> docs
= new HashMap
<String
, Document
>();
40 private Map
<String
,String
[]> fieldHighlightMap
;
43 public double getScore() {
48 public void setScore(float score
) {
53 public Map
<String
,String
[]> getFieldHighlightMap() {
54 return fieldHighlightMap
;
57 public void setFieldHighlightMap(Map
<String
,String
[]> fieldHighlightMap
) {
58 this.fieldHighlightMap
= fieldHighlightMap
;
63 public float getMaxScore() {
68 public void setMaxScore(float maxScore
) {
69 this.maxScore
= maxScore
;
73 public Collection
<Document
> getDocs() {
78 public void addDoc(Document doc
) {
79 String key
= doc
.getValues(ProjectionConstants
.OBJECT_CLASS
)[0] + "." + doc
.getValues(LuceneSearch
.ID_FIELD
)[0];
80 this.docs
.put(key
, doc
);