-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Can not upgrade kuromoji plugin from elasticsearch 0.90.5
Due to fix [3790](elastic/elasticsearch#3790) in core, upgrading an analyzer provided as a plugin now fails. See elastic/elasticsearch#5030 for details. Issue is in elasticsearch core code but can be fixed in plugins by overloading `PreBuiltAnalyzerProviderFactory`, `PreBuiltTokenFilterFactoryFactory`, `PreBuiltTokenizerFactoryFactory` or `PreBuiltCharFilterFactoryFactory ` when used. Closes #21
- Loading branch information
Showing
4 changed files
with
120 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
src/main/java/org/elasticsearch/indices/analysis/KurumojiCharFilterFactoryFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Licensed to Elasticsearch (the "Author") under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. Author licenses this | ||
* file to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package org.elasticsearch.indices.analysis; | ||
|
||
import org.elasticsearch.common.settings.Settings; | ||
import org.elasticsearch.index.analysis.CharFilterFactory; | ||
import org.elasticsearch.index.analysis.PreBuiltCharFilterFactoryFactory; | ||
|
||
public class KurumojiCharFilterFactoryFactory extends PreBuiltCharFilterFactoryFactory { | ||
private final CharFilterFactory charFilterFactory; | ||
|
||
public KurumojiCharFilterFactoryFactory(CharFilterFactory charFilterFactory) { | ||
super(charFilterFactory); | ||
this.charFilterFactory = charFilterFactory; | ||
} | ||
|
||
@Override | ||
public CharFilterFactory create(String name, Settings settings) { | ||
return charFilterFactory; | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
src/main/java/org/elasticsearch/indices/analysis/KurumojiTokenFilterFactoryFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Licensed to Elasticsearch (the "Author") under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. Author licenses this | ||
* file to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package org.elasticsearch.indices.analysis; | ||
|
||
import org.elasticsearch.common.settings.Settings; | ||
import org.elasticsearch.index.analysis.PreBuiltTokenFilterFactoryFactory; | ||
import org.elasticsearch.index.analysis.TokenFilterFactory; | ||
|
||
public class KurumojiTokenFilterFactoryFactory extends PreBuiltTokenFilterFactoryFactory { | ||
private final TokenFilterFactory tokenFilterFactory; | ||
|
||
public KurumojiTokenFilterFactoryFactory(TokenFilterFactory tokenFilterFactory) { | ||
super(tokenFilterFactory); | ||
this.tokenFilterFactory = tokenFilterFactory; | ||
} | ||
|
||
@Override | ||
public TokenFilterFactory create(String name, Settings settings) { | ||
return tokenFilterFactory; | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
src/main/java/org/elasticsearch/indices/analysis/KurumojiTokenizerFactoryFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Licensed to Elasticsearch (the "Author") under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. Author licenses this | ||
* file to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package org.elasticsearch.indices.analysis; | ||
|
||
import org.elasticsearch.common.settings.Settings; | ||
import org.elasticsearch.index.analysis.PreBuiltTokenizerFactoryFactory; | ||
import org.elasticsearch.index.analysis.TokenizerFactory; | ||
|
||
public class KurumojiTokenizerFactoryFactory extends PreBuiltTokenizerFactoryFactory { | ||
private final TokenizerFactory tokenizerFactory; | ||
|
||
public KurumojiTokenizerFactoryFactory(TokenizerFactory tokenizerFactory) { | ||
super(tokenizerFactory); | ||
this.tokenizerFactory = tokenizerFactory; | ||
} | ||
|
||
@Override | ||
public TokenizerFactory create(String name, Settings settings) { | ||
return tokenizerFactory; | ||
} | ||
} |