1 package net.sf.cantina.search;
2
3 import net.sf.cantina.DocumentSearchResult;
4 import net.sf.cantina.util.Localizer;
5 import org.apache.lucene.search.Query;
6
7 import java.util.Locale;
8
9 /***
10 * @author Stephane JAIS
11 */
12 public class LuceneDocumentSearchResult
13 implements DocumentSearchResult
14 {
15 org.apache.lucene.document.Document itsLuceneDocument;
16 float itsScore;
17 Query itsQuery;
18 public LuceneDocumentSearchResult(
19 org.apache.lucene.document.Document luceneDoc,
20 Query query,
21 float score)
22 {
23 itsLuceneDocument = luceneDoc;
24 itsScore = score;
25 query = itsQuery;
26 }
27 public String getDocumentId()
28 {
29 return itsLuceneDocument.get("documentId");
30 }
31
32 public Locale getLocale()
33 {
34 return Localizer.parseLocaleString(itsLuceneDocument.get("locale"));
35 }
36
37 public float getScore()
38 {
39 return itsScore;
40 }
41
42 public static String stripOutColumnModifiers(String query)
43 {
44 return null;
45 }
46 }