Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changes for elasticsearch 7.11.x #44

Open
wants to merge 8 commits into
base: 7.10
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,15 @@ asciidoctor {
'source-highlighter': 'coderay'
}

checkstyleMain.source = 'src/main/java'
//checkstyleMain.source = 'src/main/java'
// we use @Ignore
forbiddenApisTest.enabled = false
forbiddenPatterns.exclude('**/*.txt', '**/*.brk', '**/*.fst', '**/*.tree', '**/*.nrm')
licenseHeaders.enabled = false
dependencyLicenses.enabled = false
thirdPartyAudit.enabled = false
loggerUsageCheck.enabled = false
testingConventions.enabled = false
//forbiddenApisTest.enabled = false
//tasks.named("forbiddenPatterns").configure {
// exclude('**/*.txt', '**/*.brk', '**/*.fst', '**/*.tree', '**/*.nrm')
//}
//licenseHeaders.enabled = false
//dependencyLicenses.enabled = false
//thirdPartyAudit.enabled = false
//loggerUsageCheck.enabled = false
//testingConventions.enabled = false
validateNebulaPom.enabled = false
40 changes: 20 additions & 20 deletions config/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,22 @@ page at http://checkstyle.sourceforge.net/config.html -->
Only allows a package-info.java, not package.html. -->
</module>

<module name="LineLength">
<!-- Checks if a line is too long. -->
<property name="max" value="${com.puppycrawl.tools.checkstyle.checks.sizes.LineLength.max}" default="128"/>
<property name="severity" value="error"/>

<!--
The default ignore pattern exempts the following elements:
- import statements
- long URLs inside comments
-->

<property name="ignorePattern"
value="${com.puppycrawl.tools.checkstyle.checks.sizes.LineLength.ignorePattern}"
default="^(package .*;\s*)|(import .*;\s*)|( *(\*|//).*https?://.*)$"/>
</module>

<!-- All Java AST specific tests live under TreeWalker module. -->
<module name="TreeWalker">

Expand Down Expand Up @@ -73,12 +89,12 @@ page at http://checkstyle.sourceforge.net/config.html -->
<module name="JavadocMethod">
<property name="scope" value="protected"/>
<property name="severity" value="warning"/>
<property name="allowMissingJavadoc" value="true"/>
<!--<property name="allowMissingJavadoc" value="true"/>-->
<property name="allowMissingParamTags" value="true"/>
<property name="allowMissingReturnTag" value="true"/>
<property name="allowMissingThrowsTags" value="true"/>
<property name="allowThrowsTagsForSubclasses" value="true"/>
<property name="allowUndeclaredRTE" value="true"/>
<!--<property name="allowMissingThrowsTags" value="true"/>-->
<!--<property name="allowThrowsTagsForSubclasses" value="true"/>-->
<!--<property name="allowUndeclaredRTE" value="true"/>-->
</module>

<module name="JavadocType">
Expand Down Expand Up @@ -184,22 +200,6 @@ page at http://checkstyle.sourceforge.net/config.html -->

-->

<module name="LineLength">
<!-- Checks if a line is too long. -->
<property name="max" value="${com.puppycrawl.tools.checkstyle.checks.sizes.LineLength.max}" default="128"/>
<property name="severity" value="error"/>

<!--
The default ignore pattern exempts the following elements:
- import statements
- long URLs inside comments
-->

<property name="ignorePattern"
value="${com.puppycrawl.tools.checkstyle.checks.sizes.LineLength.ignorePattern}"
default="^(package .*;\s*)|(import .*;\s*)|( *(\*|//).*https?://.*)$"/>
</module>

<module name="LeftCurly">
<!-- Checks for placement of the left curly brace ('{'). -->
<property name="severity" value="warning"/>
Expand Down
9 changes: 4 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
group = org.xbib.elasticsearch
name = elasticsearch-plugin-bundle
version = 7.10.1.0
version = 7.11.1.0

elasticsearch.version = 7.10.1
elasticsearch.version = 7.11.1
lucene.version = 8.7.0

icu4j.version = 67.1
standardnumber.version = 1.0.1
jackson.version = 2.9.10
jackson.version = 2.10.4
spatial4j.version = 0.7
jts.version = 1.15.1
jna.version = 4.5.1
checkstyle.version = 8.13
jna.version = 5.5.0
wagon.version = 3.0.0

log4j.version = 2.13.1
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
import org.xbib.elasticsearch.plugin.bundle.action.isbnformat.TransportISBNFormatAction;
import org.xbib.elasticsearch.plugin.bundle.action.langdetect.LangdetectAction;
import org.xbib.elasticsearch.plugin.bundle.action.langdetect.TransportLangdetectAction;
import org.xbib.elasticsearch.plugin.bundle.common.standardnumber.StandardnumberService;
import org.xbib.elasticsearch.plugin.bundle.index.analysis.autophrase.AutoPhrasingTokenFilterFactory;
import org.xbib.elasticsearch.plugin.bundle.index.analysis.baseform.BaseformTokenFilterFactory;
import org.xbib.elasticsearch.plugin.bundle.index.analysis.concat.ConcatTokenFilterFactory;
import org.xbib.elasticsearch.plugin.bundle.index.analysis.concat.PairTokenFilterFactory;
import org.xbib.elasticsearch.plugin.bundle.index.analysis.decompound.patricia.DecompoundTokenFilterFactory;
import org.xbib.elasticsearch.plugin.bundle.index.analysis.decompound.fst.FstDecompoundTokenFilterFactory;
import org.xbib.elasticsearch.plugin.bundle.index.analysis.lemmatize.LemmatizeTokenFilterFactory;
import org.xbib.elasticsearch.plugin.bundle.index.analysis.decompound.patricia.DecompoundTokenFilterFactory;
import org.xbib.elasticsearch.plugin.bundle.index.analysis.german.GermanNormalizationFilterFactory;
import org.xbib.elasticsearch.plugin.bundle.index.analysis.hyphen.HyphenAnalyzerProvider;
import org.xbib.elasticsearch.plugin.bundle.index.analysis.hyphen.HyphenTokenFilterFactory;
Expand All @@ -51,6 +51,7 @@
import org.xbib.elasticsearch.plugin.bundle.index.analysis.icu.IcuNumberFormatTokenFilterFactory;
import org.xbib.elasticsearch.plugin.bundle.index.analysis.icu.IcuTransformTokenFilterFactory;
import org.xbib.elasticsearch.plugin.bundle.index.analysis.icu.segmentation.IcuTokenizerFactory;
import org.xbib.elasticsearch.plugin.bundle.index.analysis.lemmatize.LemmatizeTokenFilterFactory;
import org.xbib.elasticsearch.plugin.bundle.index.analysis.naturalsort.NaturalSortKeyAnalyzerProvider;
import org.xbib.elasticsearch.plugin.bundle.index.analysis.naturalsort.NaturalSortKeyTokenizerFactory;
import org.xbib.elasticsearch.plugin.bundle.index.analysis.sortform.SortformAnalyzerProvider;
Expand All @@ -65,12 +66,8 @@
import org.xbib.elasticsearch.plugin.bundle.index.mapper.langdetect.LangdetectMapper;
import org.xbib.elasticsearch.plugin.bundle.index.mapper.reference.ReferenceMapper;
import org.xbib.elasticsearch.plugin.bundle.index.mapper.reference.ReferenceMapperModule;
import org.xbib.elasticsearch.plugin.bundle.index.mapper.reference.ReferenceMapperTypeParser;
import org.xbib.elasticsearch.plugin.bundle.common.reference.ReferenceService;
import org.xbib.elasticsearch.plugin.bundle.index.mapper.standardnumber.StandardnumberMapper;
import org.xbib.elasticsearch.plugin.bundle.index.mapper.standardnumber.StandardnumberMapperModule;
import org.xbib.elasticsearch.plugin.bundle.index.mapper.standardnumber.StandardnumberMapperTypeParser;
import org.xbib.elasticsearch.plugin.bundle.common.standardnumber.StandardnumberService;
import org.xbib.elasticsearch.plugin.bundle.query.decompound.ExactPhraseQueryBuilder;
import org.xbib.elasticsearch.plugin.bundle.rest.action.isbnformat.RestISBNFormatterAction;
import org.xbib.elasticsearch.plugin.bundle.rest.action.langdetect.RestLangdetectAction;
Expand All @@ -90,11 +87,9 @@
*/
public class BundlePlugin extends Plugin implements AnalysisPlugin, MapperPlugin, SearchPlugin, ActionPlugin {

private static final StandardnumberMapperTypeParser standardNumberTypeParser =
new StandardnumberMapperTypeParser();
private final StandardnumberMapper.TypeParser standardNumberTypeParser = StandardnumberMapper.newTypeParser();

private static final ReferenceMapperTypeParser referenceMapperTypeParser =
new ReferenceMapperTypeParser();
private final ReferenceMapper.TypeParser referenceMapperTypeParser = ReferenceMapper.PARSER;

private final Settings settings;

Expand Down Expand Up @@ -244,10 +239,10 @@ public Map<String, Mapper.TypeParser> getMappers() {
extra.put(ReferenceMapper.CONTENT_TYPE, referenceMapperTypeParser);
}
if (settings.getAsBoolean("plugins.xbib.langdetect.enabled", true)) {
extra.put(LangdetectMapper.CONTENT_TYPE, new LangdetectMapper.TypeParser());
extra.put(LangdetectMapper.CONTENT_TYPE, LangdetectMapper.PARSER);
}
if (settings.getAsBoolean("plugins.xbib.icu.enabled", true)) {
extra.put(IcuCollationKeyFieldMapper.CONTENT_TYPE, new IcuCollationKeyFieldMapper.TypeParser());
extra.put(IcuCollationKeyFieldMapper.CONTENT_TYPE, IcuCollationKeyFieldMapper.PARSER);
}
return extra;
}
Expand Down Expand Up @@ -304,9 +299,6 @@ public Collection<Module> createGuiceModules() {
@Override
public Collection<Class<? extends LifecycleComponent>> getGuiceServiceClasses() {
Collection<Class<? extends LifecycleComponent>> extra = new ArrayList<>();
if (settings.getAsBoolean("plugins.xbib.reference.enabled", true)) {
extra.add(ReferenceService.class);
}
if (settings.getAsBoolean("plugins.xbib.standardnumber.enabled", true)) {
extra.add(StandardnumberService.class);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class TransportISBNFormatAction extends TransportAction<ISBNFormatRequest
public TransportISBNFormatAction(ActionFilters actionFilters,
TransportService transportService,
StandardnumberService standardnumberService) {
super(ISBNFormatAction.NAME, actionFilters, transportService.getTaskManager());
super(ISBNFormatAction.NAME, actionFilters, transportService.getLocalNodeConnection(), transportService.getTaskManager());
this.standardnumberService = standardnumberService;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class TransportLangdetectAction extends TransportAction<LangdetectRequest
public TransportLangdetectAction(Settings settings,
ActionFilters actionFilters,
TransportService transportService) {
super(LangdetectAction.NAME, actionFilters, transportService.getTaskManager());
super(LangdetectAction.NAME, actionFilters, transportService.getLocalNodeConnection(), transportService.getTaskManager());
this.settings = settings;
services.put("", new LangdetectService(settings));
}
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.elasticsearch.common.component.AbstractLifecycleComponent;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings;
import org.xbib.elasticsearch.plugin.bundle.action.isbnformat.ISBNFormatResponse;
import org.xbib.elasticsearch.plugin.bundle.index.mapper.standardnumber.StandardnumberMapper;
import org.xbib.elasticsearch.plugin.bundle.index.analysis.standardnumber.StandardnumberTokenFilter;
import org.xbib.elasticsearch.plugin.bundle.index.mapper.standardnumber.StandardnumberMapper;
import org.xbib.standardnumber.ISBN;
import org.xbib.standardnumber.NoSuchStandardNumberException;
import org.xbib.standardnumber.StandardNumber;
Expand All @@ -26,11 +27,8 @@ public class StandardnumberService extends AbstractLifecycleComponent {
private static final List<String> DEFAULT_STANDARD_NUMBERS =
Arrays.asList("isbn", "issn", "ismn", "isni", "orcid", "ppn", "zdb");

/**
* Called from StandardnumberTokenFilterFactory.
* @param standardNumberTypeParser the type parser
*/
public void setStandardNumberTypeParser(StandardnumberMapper.TypeParser standardNumberTypeParser) {
@Inject
public StandardnumberService(StandardnumberMapper.TypeParser standardNumberTypeParser) {
standardNumberTypeParser.setService(this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import org.elasticsearch.env.Environment;
import org.elasticsearch.index.IndexSettings;
import org.elasticsearch.index.analysis.AbstractTokenFilterFactory;
import org.xbib.elasticsearch.plugin.bundle.index.mapper.standardnumber.StandardnumberMapper;
import org.xbib.elasticsearch.plugin.bundle.common.standardnumber.StandardnumberService;
import org.xbib.elasticsearch.plugin.bundle.index.mapper.standardnumber.StandardnumberMapper;

/**
* Standard number token filter factory.
Expand All @@ -24,8 +24,7 @@ public StandardnumberTokenFilterFactory(IndexSettings indexSettings,
StandardnumberMapper.TypeParser standardNumberTypeParser) {
super(indexSettings, name, settings);
this.settings = settings;
this.standardnumberService = new StandardnumberService();
this.standardnumberService.setStandardNumberTypeParser(standardNumberTypeParser);
this.standardnumberService = new StandardnumberService(standardNumberTypeParser);
}

@Override
Expand Down
Loading