Skip to content

Commit 234384f

Browse files
committed
Fixed problem with backward compatibility
- add new constructor Signed-off-by:Jacek Grzebyta <grzebyta.dev@gmail.com>
1 parent dec66c1 commit 234384f

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

  • core/sail/fts/lucene/src/main/java/org/eclipse/rdf4j/sail/lucene

core/sail/fts/lucene/src/main/java/org/eclipse/rdf4j/sail/lucene/LuceneIndex.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,21 +139,36 @@ public class LuceneIndex extends AbstractLuceneIndex {
139139
public LuceneIndex() {
140140
}
141141

142+
/**
143+
* Constructor for keeping backwards compatibility.
144+
*
145+
* @param directory
146+
* @param analyzer
147+
*/
148+
public LuceneIndex(Directory directory, Analyzer analyzer)
149+
throws IOException
150+
{
151+
this(directory, analyzer, new DefaultSimilarity());
152+
}
153+
142154
/**
143155
* Creates a new LuceneIndex.
144156
*
145157
* @param directory
146158
* The Directory in which an index can be found and/or in which index files are written.
147159
* @param analyzer
148160
* The Analyzer that will be used for tokenizing strings to index and queries.
161+
* @param similarity
162+
* The Similarity that will be used for scoring.
149163
* @throws IOException
150164
* When the Directory could not be unlocked.
151165
*/
152-
public LuceneIndex(Directory directory, Analyzer analyzer)
166+
public LuceneIndex(Directory directory, Analyzer analyzer, Similarity similarity)
153167
throws IOException
154168
{
155169
this.directory = directory;
156170
this.analyzer = analyzer;
171+
this.similarity = similarity;
157172
this.geoStrategyMapper = createSpatialStrategyMapper(Collections.<String, String> emptyMap());
158173

159174
postInit();

0 commit comments

Comments
 (0)