Skip to content

Commit

Permalink
Update to Elasticsearch 0.90.3 / Lucene 4.4.0
Browse files Browse the repository at this point in the history
Closes #6.
  • Loading branch information
dadoonet committed Aug 8, 2013
1 parent e7a2f7d commit fc23bfd
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 19 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
----------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

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;
Expand All @@ -34,7 +35,6 @@

public class KuromojiPartOfSpeechFilterFactory extends AbstractTokenFilterFactory {

private final boolean enablePositionIncrements;
private final Set<String> stopTags = new HashSet<String>();

@Inject
Expand All @@ -44,12 +44,11 @@ public KuromojiPartOfSpeechFilterFactory(Index index, @IndexSettings Settings in
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);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -37,6 +31,8 @@
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.
Expand Down Expand Up @@ -85,7 +81,7 @@ public String name() {

@Override
public TokenStream create(TokenStream tokenStream) {
return new JapanesePartOfSpeechStopFilter(false,
return new JapanesePartOfSpeechStopFilter(Version.LUCENE_44,
tokenStream, JapaneseAnalyzer
.getDefaultStopTags());
}
Expand Down Expand Up @@ -118,4 +114,4 @@ public TokenStream create(TokenStream tokenStream) {
}
}));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
},
"kuromoji_pos" : {
"type": "kuromoji_part_of_speech",
"enable_position_increment" : "false",
"stoptags" : ["# verb-main:", "動詞-自立"]
},
"kuromoji_ks" : {
Expand All @@ -34,4 +33,4 @@

}
}
}
}

0 comments on commit fc23bfd

Please sign in to comment.