Skip to content

Commit

Permalink
support lower versions
Browse files Browse the repository at this point in the history
  • Loading branch information
mh-northlander committed May 21, 2024
1 parent 29a58b6 commit e3b33b5
Show file tree
Hide file tree
Showing 8 changed files with 108 additions and 23 deletions.
7 changes: 5 additions & 2 deletions buildSrc/src/main/groovy/com/worksap/nlp/tools/engines.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ enum EsSupport implements EngineSupport {

enum OsSupport implements EngineSupport {
Os20("os-2.00"),
Os210("os-2.10")
Os27("os-2.07"),
Os210("os-2.10"),

String tag

Expand All @@ -59,8 +60,10 @@ enum OsSupport implements EngineSupport {


static OsSupport supportVersion(Version version) {
if (version.ge(2, 0) && version.lt(2, 10)) {
if (version.ge(2, 0) && version.lt(2, 7)) {
return Os20
} else if (version.ge(2, 7) && version.lt(2, 10)) {
return Os27
} else if (version.ge(2, 10)) {
return Os210
}
Expand Down
25 changes: 25 additions & 0 deletions src/main/ext/es-7.15-ge/xcontent-aliases.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright (c) 2024 Works Applications Co., Ltd.
*
* Licensed 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.
*/

@file:Suppress("PackageDirectoryMismatch")

package com.worksap.nlp.lucene.aliases

typealias ToXContent = org.elasticsearch.xcontent.ToXContent

typealias ToXContentParams = org.elasticsearch.xcontent.ToXContent.Params

typealias XContentBuilder = org.elasticsearch.xcontent.XContentBuilder
25 changes: 25 additions & 0 deletions src/main/ext/es-7.15-lt/xcontent-aliases.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright (c) 2024 Works Applications Co., Ltd.
*
* Licensed 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.
*/

@file:Suppress("PackageDirectoryMismatch")

package com.worksap.nlp.lucene.aliases

typealias ToXContent = org.elasticsearch.common.xcontent.ToXContent

typealias ToXContentParams = org.elasticsearch.common.xcontent.ToXContent.Params

typealias XContentBuilder = org.elasticsearch.common.xcontent.XContentBuilder
8 changes: 1 addition & 7 deletions src/main/ext/es-8.00-ge/lucene-aliases.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023-2024 Works Applications Co., Ltd.
* Copyright (c) 2023 Works Applications Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -23,9 +23,3 @@ typealias TokenFilterFactory = org.apache.lucene.analysis.TokenFilterFactory
typealias ResourceLoaderArgument = org.apache.lucene.util.ResourceLoader

typealias ResourceLoaderAware = org.apache.lucene.util.ResourceLoaderAware

typealias ToXContent = org.elasticsearch.xcontent.ToXContent

typealias ToXContentParams = org.elasticsearch.xcontent.ToXContent.Params

typealias XContentBuilder = org.elasticsearch.xcontent.XContentBuilder
8 changes: 1 addition & 7 deletions src/main/ext/es-8.00-lt/lucene-aliases.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023-2024 Works Applications Co., Ltd.
* Copyright (c) 2023 Works Applications Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -23,9 +23,3 @@ typealias TokenFilterFactory = org.apache.lucene.analysis.util.TokenFilterFactor
typealias ResourceLoaderArgument = org.apache.lucene.analysis.util.ResourceLoader

typealias ResourceLoaderAware = org.apache.lucene.analysis.util.ResourceLoaderAware

typealias ToXContent = org.elasticsearch.xcontent.ToXContent

typealias ToXContentParams = org.elasticsearch.xcontent.ToXContent.Params

typealias XContentBuilder = org.elasticsearch.xcontent.XContentBuilder
8 changes: 1 addition & 7 deletions src/main/ext/os-2.00-ge/lucene-aliases.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023-2024 Works Applications Co., Ltd.
* Copyright (c) 2023 Works Applications Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -23,9 +23,3 @@ typealias TokenFilterFactory = org.apache.lucene.analysis.TokenFilterFactory
typealias ResourceLoaderArgument = org.apache.lucene.util.ResourceLoader

typealias ResourceLoaderAware = org.apache.lucene.util.ResourceLoaderAware

typealias ToXContent = org.opensearch.core.xcontent.ToXContent

typealias ToXContentParams = org.opensearch.core.xcontent.ToXContent.Params

typealias XContentBuilder = org.opensearch.core.xcontent.XContentBuilder
25 changes: 25 additions & 0 deletions src/main/ext/os-2.07-ge/xcontent-aliases.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright (c) 2024 Works Applications Co., Ltd.
*
* Licensed 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.
*/

@file:Suppress("PackageDirectoryMismatch")

package com.worksap.nlp.lucene.aliases

typealias ToXContent = org.opensearch.core.xcontent.ToXContent

typealias ToXContentParams = org.opensearch.core.xcontent.ToXContent.Params

typealias XContentBuilder = org.opensearch.core.xcontent.XContentBuilder
25 changes: 25 additions & 0 deletions src/main/ext/os-2.07-lt/xcontent-aliases.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright (c) 2024 Works Applications Co., Ltd.
*
* Licensed 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.
*/

@file:Suppress("PackageDirectoryMismatch")

package com.worksap.nlp.lucene.aliases

typealias ToXContent = org.opensearch.common.xcontent.ToXContent

typealias ToXContentParams = org.opensearch.common.xcontent.ToXContent.Params

typealias XContentBuilder = org.opensearch.common.xcontent.XContentBuilder

0 comments on commit e3b33b5

Please sign in to comment.