Update to Elasticsearch 0.90.3 / Lucene 4.4.0

Closes #6.
This commit is contained in:
David Pilato 2013-08-08 15:43:00 +02:00
parent e7a2f7d7b3
commit fc23bfd8f2
5 changed files with 13 additions and 19 deletions

View File

@ -8,9 +8,9 @@ In order to install the plugin, simply run: `bin/plugin -install elasticsearch/e
----------------------------------------------------
| Kuromoji Analysis Plugin | ElasticSearch |
----------------------------------------------------
| 1.5.0-SNAPSHOT (master) | 0.90.1 -> master |
| 1.5.0-SNAPSHOT (master) | 0.90.3 -> master |
----------------------------------------------------
| 1.4.0 | 0.90.1 |
| 1.4.0 | 0.90.1 -> 0.90.2 |
----------------------------------------------------
| 1.3.0 | 0.90.0 |
----------------------------------------------------

View File

@ -31,8 +31,8 @@
</parent>
<properties>
<elasticsearch.version>0.90.1</elasticsearch.version>
<lucene.version>4.3.0</lucene.version>
<elasticsearch.version>0.90.3</elasticsearch.version>
<lucene.version>4.4.0</lucene.version>
</properties>
<repositories>

View File

@ -21,6 +21,7 @@ package org.elasticsearch.index.analysis;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.ja.JapanesePartOfSpeechStopFilter;
import org.apache.lucene.util.Version;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.inject.assistedinject.Assisted;
import org.elasticsearch.common.settings.Settings;
@ -34,7 +35,6 @@ import java.util.Set;
public class KuromojiPartOfSpeechFilterFactory extends AbstractTokenFilterFactory {
private final boolean enablePositionIncrements;
private final Set<String> stopTags = new HashSet<String>();
@Inject
@ -44,12 +44,11 @@ public class KuromojiPartOfSpeechFilterFactory extends AbstractTokenFilterFactor
if (wordList != null) {
stopTags.addAll(wordList);
}
this.enablePositionIncrements = settings.getAsBoolean("enable_position_increments", true);
}
@Override
public TokenStream create(TokenStream tokenStream) {
return new JapanesePartOfSpeechStopFilter(enablePositionIncrements, tokenStream, stopTags);
return new JapanesePartOfSpeechStopFilter(Version.LUCENE_44, tokenStream, stopTags);
}
}

View File

@ -18,17 +18,11 @@
*/
package org.elasticsearch.indices.analysis;
import java.io.Reader;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.Tokenizer;
import org.apache.lucene.analysis.ja.JapaneseAnalyzer;
import org.apache.lucene.analysis.ja.JapaneseBaseFormFilter;
import org.apache.lucene.analysis.ja.JapaneseKatakanaStemFilter;
import org.apache.lucene.analysis.ja.JapanesePartOfSpeechStopFilter;
import org.apache.lucene.analysis.ja.JapaneseReadingFormFilter;
import org.apache.lucene.analysis.ja.JapaneseTokenizer;
import org.apache.lucene.analysis.ja.*;
import org.apache.lucene.analysis.ja.JapaneseTokenizer.Mode;
import org.apache.lucene.util.Version;
import org.elasticsearch.common.component.AbstractComponent;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings;
@ -37,6 +31,8 @@ import org.elasticsearch.index.analysis.PreBuiltTokenizerFactoryFactory;
import org.elasticsearch.index.analysis.TokenFilterFactory;
import org.elasticsearch.index.analysis.TokenizerFactory;
import java.io.Reader;
/**
* Registers indices level analysis components so, if not explicitly configured,
* will be shared among all indices.
@ -85,7 +81,7 @@ public class KuromojiIndicesAnalysis extends AbstractComponent {
@Override
public TokenStream create(TokenStream tokenStream) {
return new JapanesePartOfSpeechStopFilter(false,
return new JapanesePartOfSpeechStopFilter(Version.LUCENE_44,
tokenStream, JapaneseAnalyzer
.getDefaultStopTags());
}
@ -118,4 +114,4 @@ public class KuromojiIndicesAnalysis extends AbstractComponent {
}
}));
}
}
}

View File

@ -8,7 +8,6 @@
},
"kuromoji_pos" : {
"type": "kuromoji_part_of_speech",
"enable_position_increment" : "false",
"stoptags" : ["# verb-main:", "動詞-自立"]
},
"kuromoji_ks" : {
@ -34,4 +33,4 @@
}
}
}
}