Update to elasticsearch 1.0.0.RC1

Closes #17.
This commit is contained in:
David Pilato 2014-01-10 23:42:48 +01:00
parent 901a6e9437
commit f44ef93d38
3 changed files with 6 additions and 9 deletions

View File

@ -6,7 +6,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch-analysis-phonetic</artifactId>
<version>1.9.0-SNAPSHOT</version>
<version>2.0.0.RC1-SNAPSHOT</version>
<packaging>jar</packaging>
<description>Phonetic Analysis for ElasticSearch</description>
<inceptionYear>2009</inceptionYear>
@ -31,7 +31,7 @@
</parent>
<properties>
<elasticsearch.version>0.90.8</elasticsearch.version>
<elasticsearch.version>1.0.0.RC1-SNAPSHOT</elasticsearch.version>
<lucene.version>4.6.0</lucene.version>
<tests.jvms>1</tests.jvms>
<tests.shuffle>true</tests.shuffle>

View File

@ -29,7 +29,7 @@ import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.phonetic.BeiderMorseFilter;
import org.apache.lucene.analysis.phonetic.DoubleMetaphoneFilter;
import org.apache.lucene.analysis.phonetic.PhoneticFilter;
import org.elasticsearch.ElasticSearchIllegalArgumentException;
import org.elasticsearch.ElasticsearchIllegalArgumentException;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.inject.assistedinject.Assisted;
import org.elasticsearch.common.settings.Settings;
@ -90,7 +90,7 @@ public class PhoneticTokenFilterFactory extends AbstractTokenFilterFactory {
} else if ("exact".equalsIgnoreCase(ruleType)) {
ruletype = RuleType.EXACT;
} else {
throw new ElasticSearchIllegalArgumentException("No matching rule type [" + ruleType + "] for beider morse encoder");
throw new ElasticsearchIllegalArgumentException("No matching rule type [" + ruleType + "] for beider morse encoder");
}
String nameType = settings.get("name_type", "generic");
if ("GENERIC".equalsIgnoreCase(nameType)) {
@ -107,7 +107,7 @@ public class PhoneticTokenFilterFactory extends AbstractTokenFilterFactory {
} else if ("nysiis".equalsIgnoreCase(encodername)) {
this.encoder = new Nysiis();
} else {
throw new ElasticSearchIllegalArgumentException("unknown encoder [" + encodername + "] for phonetic token filter");
throw new ElasticsearchIllegalArgumentException("unknown encoder [" + encodername + "] for phonetic token filter");
}
}
@ -127,6 +127,6 @@ public class PhoneticTokenFilterFactory extends AbstractTokenFilterFactory {
} else {
return new PhoneticFilter(tokenStream, encoder, !replace);
}
throw new ElasticSearchIllegalArgumentException("encoder error");
throw new ElasticsearchIllegalArgumentException("encoder error");
}
}

View File

@ -45,10 +45,7 @@ public class SimplePhoneticAnalysisTests extends ElasticsearchTestCase {
public void testPhoneticTokenFilterFactory() {
Settings settings = settingsBuilder().loadFromClasspath("org/elasticsearch/index/analysis/phonetic-1.yml").build();
AnalysisService analysisService = testSimpleConfiguration(settings);
TokenFilterFactory standardfilterFactory = analysisService.tokenFilter("standard");
System.err.println("standard filterfactory = " + standardfilterFactory);
TokenFilterFactory filterFactory = analysisService.tokenFilter("phonetic");
System.err.println("filterfactory = " + filterFactory);
MatcherAssert.assertThat(filterFactory, instanceOf(PhoneticTokenFilterFactory.class));
}