55 */
66package com .mysema .rdfbean .lucene ;
77
8- import org .apache .lucene .analysis .Analyzer ;
9- import org .apache .lucene .analysis .standard .StandardAnalyzer ;
10- import org .apache .lucene .store .Directory ;
11- import org .apache .lucene .util .Version ;
8+ import static org .compass .core .mapping .rsem .builder .RSEM .id ;
9+ import static org .compass .core .mapping .rsem .builder .RSEM .property ;
10+ import static org .compass .core .mapping .rsem .builder .RSEM .resource ;
11+
12+ import org .compass .core .Property .Index ;
13+ import org .compass .core .Property .Store ;
14+ import org .compass .core .config .CompassConfiguration ;
15+
1216
1317/**
1418 * LuceneConfiguration provides
1721 * @version $Id$
1822 */
1923public class LuceneConfiguration {
20-
21- private static final Analyzer DEFAULT_ANALYZER = new StandardAnalyzer (Version .LUCENE_30 );
22-
24+
2325 private NodeConverter converter = NodeConverter .DEFAULT ;
2426
25- private Analyzer analyzer = DEFAULT_ANALYZER ;
27+ private CompassConfiguration compassConfig ;
2628
27- private Directory directory ;
29+ private boolean allIndexed = true ;
2830
2931 private boolean fullTextIndexed = true ;
3032
@@ -48,22 +50,6 @@ public void setStored(boolean stored) {
4850 this .stored = stored ;
4951 }
5052
51- public Analyzer getAnalyzer () {
52- return analyzer ;
53- }
54-
55- public void setAnalyzer (Analyzer analyzer ) {
56- this .analyzer = analyzer ;
57- }
58-
59- public Directory getDirectory () {
60- return directory ;
61- }
62-
63- public void setDirectory (Directory directory ) {
64- this .directory = directory ;
65- }
66-
6753 public boolean isFullTextIndexed () {
6854 return fullTextIndexed ;
6955 }
@@ -79,7 +65,37 @@ public boolean isContextsStored() {
7965 public void setContextsStored (boolean contextsStored ) {
8066 this .contextsStored = contextsStored ;
8167 }
82-
83-
68+
69+ public CompassConfiguration getCompassConfig () {
70+ return compassConfig ;
71+ }
72+
73+ public void setCompassConfig (CompassConfiguration compassConfig ) {
74+ this .compassConfig = compassConfig ;
75+ }
76+
77+ public boolean isAllIndexed () {
78+ return allIndexed ;
79+ }
80+
81+ public void setAllIndexed (boolean allIndexed ) {
82+ this .allIndexed = allIndexed ;
83+ }
84+
85+ public void initialize () {
86+ // mapping for general resources
87+ compassConfig .addMapping (
88+ resource ("resource" )
89+ // if field
90+ .add (id (Constants .ID_FIELD_NAME ))
91+ // context data
92+ .add (property (Constants .CONTEXT_FIELD_NAME ).store (Store .YES ).index (Index .NOT_ANALYZED ))
93+ // all field for Object data
94+ .add (property (Constants .ALL_FIELD_NAME ).store (Store .NO ).index (Index .NOT_ANALYZED ))
95+ // full text for String literals
96+ .add (property (Constants .TEXT_FIELD_NAME ).store (Store .NO ).index (Index .ANALYZED )));
97+
98+ // TODO : rdf:type
99+ }
84100
85101}
0 commit comments