1
|
// $Id$
|
2
|
/**
|
3
|
* Copyright (C) 2012 EDIT
|
4
|
* European Distributed Institute of Taxonomy
|
5
|
* http://www.e-taxonomy.eu
|
6
|
*
|
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.
|
9
|
*/
|
10
|
package eu.etaxonomy.cdm.hibernate.search;
|
11
|
|
12
|
import org.apache.log4j.Logger;
|
13
|
import org.apache.lucene.document.Document;
|
14
|
import org.apache.lucene.document.Field.Index;
|
15
|
import org.apache.lucene.document.Field.Store;
|
16
|
import org.apache.lucene.document.Field.TermVector;
|
17
|
import org.hibernate.search.bridge.LuceneOptions;
|
18
|
|
19
|
/**
|
20
|
* Global default options for ID fields:
|
21
|
* <ul>
|
22
|
* <li>Store.YES</li>
|
23
|
* <li>Index.NOT_ANALYZED</li>
|
24
|
* <li>TermVector.NO</li>
|
25
|
* <li>Boost = 1.0f (neutral default boost)</li>
|
26
|
*
|
27
|
* @author andreas
|
28
|
* @date Sep 24, 2012
|
29
|
*
|
30
|
*/
|
31
|
public class SortFieldOptions implements LuceneOptions {
|
32
|
private static final Logger logger = Logger.getLogger(SortFieldOptions.class);
|
33
|
|
34
|
@Override
|
35
|
public Store getStore() {
|
36
|
return Store.YES;
|
37
|
}
|
38
|
|
39
|
@Override
|
40
|
public Index getIndex() {
|
41
|
return Index.NOT_ANALYZED;
|
42
|
}
|
43
|
|
44
|
@Override
|
45
|
public TermVector getTermVector() {
|
46
|
return TermVector.NO;
|
47
|
}
|
48
|
|
49
|
@Override
|
50
|
public float getBoost() {
|
51
|
return 1.0f;
|
52
|
}
|
53
|
|
54
|
@Override
|
55
|
public void addFieldToDocument(String arg0, String arg1, Document arg2) {
|
56
|
logger.warn("not yet implemented");
|
57
|
// TODO Auto-generated method stub
|
58
|
|
59
|
}
|
60
|
|
61
|
@Override
|
62
|
public void addNumericFieldToDocument(String arg0, Object arg1, Document arg2) {
|
63
|
logger.warn("not yet implemented");
|
64
|
// TODO Auto-generated method stub
|
65
|
|
66
|
}
|
67
|
|
68
|
@Override
|
69
|
public String indexNullAs() {
|
70
|
// TODO Auto-generated method stub
|
71
|
logger.warn("not yet implemented");
|
72
|
return null;
|
73
|
}
|
74
|
|
75
|
@Override
|
76
|
public boolean isCompressed() {
|
77
|
// TODO Auto-generated method stub
|
78
|
logger.warn("not yet implemented");
|
79
|
return false;
|
80
|
}
|
81
|
|
82
|
}
|