Skip to content

Commit baa1e50

Browse files
authored
Merge branch 'main' into dependabot/gradle/plugins/repository-gcs/com.google.cloud-google-cloud-core-http-2.47.0
Signed-off-by: gaobinlong <[email protected]>
2 parents 8c5a5a1 + 3f18562 commit baa1e50

File tree

146 files changed

+4983
-912
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+4983
-912
lines changed

.ci/bwcVersions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,5 @@ BWC_VERSION:
4141
- "2.17.1"
4242
- "2.17.2"
4343
- "2.18.0"
44+
- "2.18.1"
4445
- "2.19.0"

.github/workflows/links.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- uses: actions/checkout@v4
1414
- name: lychee Link Checker
1515
id: lychee
16-
uses: lycheeverse/lychee-action@v2.0.2
16+
uses: lycheeverse/lychee-action@v2.1.0
1717
with:
1818
args: --accept=200,403,429 --exclude-mail **/*.html **/*.md **/*.txt **/*.json --exclude-file .lychee.excludes
1919
fail: true

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,30 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
77
### Added
88
- Latency and Memory allocation improvements to Multi Term Aggregation queries ([#14993](https://github.com/opensearch-project/OpenSearch/pull/14993))
99
- Add support for restoring from snapshot with search replicas ([#16111](https://github.com/opensearch-project/OpenSearch/pull/16111))
10+
- Ensure support of the transport-nio by security plugin ([#16474](https://github.com/opensearch-project/OpenSearch/pull/16474))
1011
- Add logic in master service to optimize performance and retain detailed logging for critical cluster operations. ([#14795](https://github.com/opensearch-project/OpenSearch/pull/14795))
1112
- Add Setting to adjust the primary constraint weights ([#16471](https://github.com/opensearch-project/OpenSearch/pull/16471))
1213
- Switch from `buildSrc/version.properties` to Gradle version catalog (`gradle/libs.versions.toml`) to enable dependabot to perform automated upgrades on common libs ([#16284](https://github.com/opensearch-project/OpenSearch/pull/16284))
14+
- Increase segrep pressure checkpoint default limit to 30 ([#16577](https://github.com/opensearch-project/OpenSearch/pull/16577/files))
15+
- Add dynamic setting allowing size > 0 requests to be cached in the request cache ([#16483](https://github.com/opensearch-project/OpenSearch/pull/16483))
16+
- Make IndexStoreListener a pluggable interface ([#16583](https://github.com/opensearch-project/OpenSearch/pull/16583))
17+
- Support for keyword fields in star-tree index ([#16233](https://github.com/opensearch-project/OpenSearch/pull/16233))
18+
- Add a flag in QueryShardContext to differentiate inner hit query ([#16600](https://github.com/opensearch-project/OpenSearch/pull/16600))
19+
- Add vertical scaling and SoftReference for snapshot repository data cache ([#16489](https://github.com/opensearch-project/OpenSearch/pull/16489))
20+
- Support prefix list for remote repository attributes([#16271](https://github.com/opensearch-project/OpenSearch/pull/16271))
21+
- Add new configuration setting `synonym_analyzer`, to the `synonym` and `synonym_graph` filters, enabling the specification of a custom analyzer for reading the synonym file ([#16488](https://github.com/opensearch-project/OpenSearch/pull/16488)).
1322

1423
### Dependencies
1524
- Bump `com.google.cloud:google-cloud-core-http` from 2.23.0 to 2.47.0 ([#16504](https://github.com/opensearch-project/OpenSearch/pull/16504))
25+
- Bump `google-auth-library-oauth2-http` from 1.7.0 to 1.29.0 in /plugins/repository-gcs ([#16520](https://github.com/opensearch-project/OpenSearch/pull/16520))
26+
- Bump `com.azure:azure-storage-common` from 12.25.1 to 12.27.1 ([#16521](https://github.com/opensearch-project/OpenSearch/pull/16521))
27+
- Bump `com.google.apis:google-api-services-compute` from v1-rev20240407-2.0.0 to v1-rev20241021-2.0.0 ([#16502](https://github.com/opensearch-project/OpenSearch/pull/16502), [#16548](https://github.com/opensearch-project/OpenSearch/pull/16548))
28+
- Bump `com.azure:azure-storage-blob` from 12.23.0 to 12.28.1 ([#16501](https://github.com/opensearch-project/OpenSearch/pull/16501))
29+
- Bump `org.apache.hadoop:hadoop-minicluster` from 3.4.0 to 3.4.1 ([#16550](https://github.com/opensearch-project/OpenSearch/pull/16550))
30+
- Bump `org.apache.xmlbeans:xmlbeans` from 5.2.1 to 5.2.2 ([#16612](https://github.com/opensearch-project/OpenSearch/pull/16612))
31+
- Bump `com.nimbusds:nimbus-jose-jwt` from 9.41.1 to 9.46 ([#16611](https://github.com/opensearch-project/OpenSearch/pull/16611))
32+
- Bump `lycheeverse/lychee-action` from 2.0.2 to 2.1.0 ([#16610](https://github.com/opensearch-project/OpenSearch/pull/16610))
33+
- Bump `me.champeau.gradle.japicmp` from 0.4.4 to 0.4.5 ([#16614](https://github.com/opensearch-project/OpenSearch/pull/16614))
1634

1735
### Changed
1836

@@ -24,6 +42,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
2442
- Fix get index settings API doesn't show `number_of_routing_shards` setting when it was explicitly set ([#16294](https://github.com/opensearch-project/OpenSearch/pull/16294))
2543
- Revert changes to upload remote state manifest using minimum codec version([#16403](https://github.com/opensearch-project/OpenSearch/pull/16403))
2644
- Ensure index templates are not applied to system indices ([#16418](https://github.com/opensearch-project/OpenSearch/pull/16418))
45+
- Remove resource usages object from search response headers ([#16532](https://github.com/opensearch-project/OpenSearch/pull/16532))
46+
- Support retrieving doc values of unsigned long field ([#16543](https://github.com/opensearch-project/OpenSearch/pull/16543))
47+
- Fix rollover alias supports restored searchable snapshot index([#16483](https://github.com/opensearch-project/OpenSearch/pull/16483))
48+
- Fix permissions error on scripted query against remote snapshot ([#16544](https://github.com/opensearch-project/OpenSearch/pull/16544))
2749

2850
### Security
2951

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
[![Security Vulnerabilities](https://img.shields.io/github/issues/opensearch-project/OpenSearch/security%20vulnerability?labelColor=red)](https://github.com/opensearch-project/OpenSearch/issues?q=is%3Aissue+is%3Aopen+label%3A"security%20vulnerability")
88
[![Open Issues](https://img.shields.io/github/issues/opensearch-project/OpenSearch)](https://github.com/opensearch-project/OpenSearch/issues)
99
[![Open Pull Requests](https://img.shields.io/github/issues-pr/opensearch-project/OpenSearch)](https://github.com/opensearch-project/OpenSearch/pulls)
10-
[![2.18.0 Open Issues](https://img.shields.io/github/issues/opensearch-project/OpenSearch/v2.18.0)](https://github.com/opensearch-project/OpenSearch/issues?q=is%3Aissue+is%3Aopen+label%3A"v2.18.0")
11-
[![2.17.2 Open Issues](https://img.shields.io/github/issues/opensearch-project/OpenSearch/v2.17.2)](https://github.com/opensearch-project/OpenSearch/issues?q=is%3Aissue+is%3Aopen+label%3A"v2.17.2")
10+
[![2.19.0 Open Issues](https://img.shields.io/github/issues/opensearch-project/OpenSearch/v2.19.0)](https://github.com/opensearch-project/OpenSearch/issues?q=is%3Aissue+is%3Aopen+label%3A"v2.19.0")
11+
[![2.18.1 Open Issues](https://img.shields.io/github/issues/opensearch-project/OpenSearch/v2.18.1)](https://github.com/opensearch-project/OpenSearch/issues?q=is%3Aissue+is%3Aopen+label%3A"v2.18.1")
1212
[![3.0.0 Open Issues](https://img.shields.io/github/issues/opensearch-project/OpenSearch/v3.0.0)](https://github.com/opensearch-project/OpenSearch/issues?q=is%3Aissue+is%3Aopen+label%3A"v3.0.0")
1313
[![GHA gradle check](https://github.com/opensearch-project/OpenSearch/actions/workflows/gradle-check.yml/badge.svg)](https://github.com/opensearch-project/OpenSearch/actions/workflows/gradle-check.yml)
1414
[![GHA validate pull request](https://github.com/opensearch-project/OpenSearch/actions/workflows/wrapper.yml/badge.svg)](https://github.com/opensearch-project/OpenSearch/actions/workflows/wrapper.yml)

buildSrc/src/main/java/org/opensearch/gradle/internal/InternalDistributionBwcSetupPlugin.java

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,15 +181,19 @@ private static List<DistributionProject> resolveArchiveProjects(File checkoutDir
181181
if (name.contains("zip") || name.contains("tar")) {
182182
int index = name.lastIndexOf('-');
183183
String baseName = name.substring(0, index);
184-
classifier = "-" + baseName + "-x64";
184+
classifier = "-" + baseName;
185+
// The x64 variants do not have the architecture built into the task name, so it needs to be appended
186+
if (name.equals("darwin-tar") || name.equals("linux-tar") || name.equals("windows-zip")) {
187+
classifier += "-x64";
188+
}
185189
extension = name.substring(index + 1);
186190
if (extension.equals("tar")) {
187191
extension += ".gz";
188192
}
189193
} else if (name.contains("deb")) {
190-
classifier = "-amd64";
194+
classifier = "_amd64";
191195
} else if (name.contains("rpm")) {
192-
classifier = "-x64";
196+
classifier = ".x86_64";
193197
}
194198
} else {
195199
extension = name.substring(4);
@@ -256,9 +260,21 @@ private static class DistributionProject {
256260
this.name = name;
257261
this.projectPath = baseDir + "/" + name;
258262
if (version.onOrAfter("1.1.0")) {
263+
// Deb uses underscores (I don't know why...):
264+
// https://github.com/opensearch-project/OpenSearch/blob/f6d9a86f0e2e8241fd58b7e8b6cdeaf931b5108f/distribution/packages/build.gradle#L139
265+
final String separator = name.equals("deb") ? "_" : "-";
259266
this.distFile = new File(
260267
checkoutDir,
261-
baseDir + "/" + name + "/build/distributions/opensearch-min-" + version + "-SNAPSHOT" + classifier + "." + extension
268+
baseDir
269+
+ "/"
270+
+ name
271+
+ "/build/distributions/opensearch-min"
272+
+ separator
273+
+ version
274+
+ "-SNAPSHOT"
275+
+ classifier
276+
+ "."
277+
+ extension
262278
);
263279
} else {
264280
this.distFile = new File(

gradle/libs.versions.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ guava = "32.1.1-jre"
2424
protobuf = "3.25.5"
2525
jakarta_annotation = "1.3.5"
2626
google_http_client = "1.44.1"
27+
google_auth = "1.29.0"
2728
tdigest = "3.3"
2829
hdrhistogram = "2.2.2"
2930
grpc = "1.68.0"

libs/core/src/main/java/org/opensearch/Version.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ public class Version implements Comparable<Version>, ToXContentFragment {
112112
public static final Version V_2_17_1 = new Version(2170199, org.apache.lucene.util.Version.LUCENE_9_11_1);
113113
public static final Version V_2_17_2 = new Version(2170299, org.apache.lucene.util.Version.LUCENE_9_11_1);
114114
public static final Version V_2_18_0 = new Version(2180099, org.apache.lucene.util.Version.LUCENE_9_12_0);
115+
public static final Version V_2_18_1 = new Version(2180199, org.apache.lucene.util.Version.LUCENE_9_12_0);
115116
public static final Version V_3_0_0 = new Version(3000099, org.apache.lucene.util.Version.LUCENE_9_12_0);
116117
public static final Version V_2_19_0 = new Version(2190099, org.apache.lucene.util.Version.LUCENE_9_12_0);
117118
public static final Version CURRENT = V_3_0_0;

modules/analysis-common/src/main/java/org/opensearch/analysis/common/CommonAnalysisModulePlugin.java

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@
146146
import org.opensearch.index.analysis.PreConfiguredTokenizer;
147147
import org.opensearch.index.analysis.TokenFilterFactory;
148148
import org.opensearch.index.analysis.TokenizerFactory;
149+
import org.opensearch.indices.analysis.AnalysisModule;
149150
import org.opensearch.indices.analysis.AnalysisModule.AnalysisProvider;
150151
import org.opensearch.indices.analysis.PreBuiltCacheFactory.CachingStrategy;
151152
import org.opensearch.plugins.AnalysisPlugin;
@@ -247,7 +248,7 @@ public Map<String, AnalysisProvider<AnalyzerProvider<? extends Analyzer>>> getAn
247248
}
248249

249250
@Override
250-
public Map<String, AnalysisProvider<TokenFilterFactory>> getTokenFilters() {
251+
public Map<String, AnalysisProvider<TokenFilterFactory>> getTokenFilters(AnalysisModule analysisModule) {
251252
Map<String, AnalysisProvider<TokenFilterFactory>> filters = new TreeMap<>();
252253
filters.put("apostrophe", ApostropheFilterFactory::new);
253254
filters.put("arabic_normalization", ArabicNormalizationFilterFactory::new);
@@ -332,14 +333,36 @@ public Map<String, AnalysisProvider<TokenFilterFactory>> getTokenFilters() {
332333
filters.put("sorani_normalization", SoraniNormalizationFilterFactory::new);
333334
filters.put("stemmer_override", requiresAnalysisSettings(StemmerOverrideTokenFilterFactory::new));
334335
filters.put("stemmer", StemmerTokenFilterFactory::new);
335-
filters.put("synonym", requiresAnalysisSettings(SynonymTokenFilterFactory::new));
336-
filters.put("synonym_graph", requiresAnalysisSettings(SynonymGraphTokenFilterFactory::new));
337336
filters.put("trim", TrimTokenFilterFactory::new);
338337
filters.put("truncate", requiresAnalysisSettings(TruncateTokenFilterFactory::new));
339338
filters.put("unique", UniqueTokenFilterFactory::new);
340339
filters.put("uppercase", UpperCaseTokenFilterFactory::new);
341340
filters.put("word_delimiter_graph", WordDelimiterGraphTokenFilterFactory::new);
342341
filters.put("word_delimiter", WordDelimiterTokenFilterFactory::new);
342+
filters.put(
343+
"synonym",
344+
requiresAnalysisSettings(
345+
(indexSettings, environment, name, settings) -> new SynonymTokenFilterFactory(
346+
indexSettings,
347+
environment,
348+
name,
349+
settings,
350+
analysisModule.getAnalysisRegistry()
351+
)
352+
)
353+
);
354+
filters.put(
355+
"synonym_graph",
356+
requiresAnalysisSettings(
357+
(indexSettings, environment, name, settings) -> new SynonymGraphTokenFilterFactory(
358+
indexSettings,
359+
environment,
360+
name,
361+
settings,
362+
analysisModule.getAnalysisRegistry()
363+
)
364+
)
365+
);
343366
return filters;
344367
}
345368

modules/analysis-common/src/main/java/org/opensearch/analysis/common/SynonymGraphTokenFilterFactory.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
import org.opensearch.env.Environment;
4141
import org.opensearch.index.IndexSettings;
4242
import org.opensearch.index.analysis.AnalysisMode;
43+
import org.opensearch.index.analysis.AnalysisRegistry;
4344
import org.opensearch.index.analysis.CharFilterFactory;
4445
import org.opensearch.index.analysis.TokenFilterFactory;
4546
import org.opensearch.index.analysis.TokenizerFactory;
@@ -49,8 +50,14 @@
4950

5051
public class SynonymGraphTokenFilterFactory extends SynonymTokenFilterFactory {
5152

52-
SynonymGraphTokenFilterFactory(IndexSettings indexSettings, Environment env, String name, Settings settings) {
53-
super(indexSettings, env, name, settings);
53+
SynonymGraphTokenFilterFactory(
54+
IndexSettings indexSettings,
55+
Environment env,
56+
String name,
57+
Settings settings,
58+
AnalysisRegistry analysisRegistry
59+
) {
60+
super(indexSettings, env, name, settings, analysisRegistry);
5461
}
5562

5663
@Override

modules/analysis-common/src/main/java/org/opensearch/analysis/common/SynonymTokenFilterFactory.java

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,13 @@
4444
import org.opensearch.index.analysis.AbstractTokenFilterFactory;
4545
import org.opensearch.index.analysis.Analysis;
4646
import org.opensearch.index.analysis.AnalysisMode;
47+
import org.opensearch.index.analysis.AnalysisRegistry;
4748
import org.opensearch.index.analysis.CharFilterFactory;
4849
import org.opensearch.index.analysis.CustomAnalyzer;
4950
import org.opensearch.index.analysis.TokenFilterFactory;
5051
import org.opensearch.index.analysis.TokenizerFactory;
5152

53+
import java.io.IOException;
5254
import java.io.Reader;
5355
import java.io.StringReader;
5456
import java.util.List;
@@ -64,8 +66,16 @@ public class SynonymTokenFilterFactory extends AbstractTokenFilterFactory {
6466
protected final Settings settings;
6567
protected final Environment environment;
6668
protected final AnalysisMode analysisMode;
67-
68-
SynonymTokenFilterFactory(IndexSettings indexSettings, Environment env, String name, Settings settings) {
69+
private final String synonymAnalyzerName;
70+
private final AnalysisRegistry analysisRegistry;
71+
72+
SynonymTokenFilterFactory(
73+
IndexSettings indexSettings,
74+
Environment env,
75+
String name,
76+
Settings settings,
77+
AnalysisRegistry analysisRegistry
78+
) {
6979
super(indexSettings, name, settings);
7080
this.settings = settings;
7181

@@ -83,6 +93,8 @@ public class SynonymTokenFilterFactory extends AbstractTokenFilterFactory {
8393
boolean updateable = settings.getAsBoolean("updateable", false);
8494
this.analysisMode = updateable ? AnalysisMode.SEARCH_TIME : AnalysisMode.ALL;
8595
this.environment = env;
96+
this.synonymAnalyzerName = settings.get("synonym_analyzer", null);
97+
this.analysisRegistry = analysisRegistry;
8698
}
8799

88100
@Override
@@ -137,6 +149,17 @@ Analyzer buildSynonymAnalyzer(
137149
List<TokenFilterFactory> tokenFilters,
138150
Function<String, TokenFilterFactory> allFilters
139151
) {
152+
if (synonymAnalyzerName != null) {
153+
Analyzer customSynonymAnalyzer;
154+
try {
155+
customSynonymAnalyzer = analysisRegistry.getAnalyzer(synonymAnalyzerName);
156+
} catch (IOException e) {
157+
throw new RuntimeException(e);
158+
}
159+
if (customSynonymAnalyzer != null) {
160+
return customSynonymAnalyzer;
161+
}
162+
}
140163
return new CustomAnalyzer(
141164
tokenizer,
142165
charFilters.toArray(new CharFilterFactory[0]),
@@ -177,5 +200,4 @@ Reader getRulesFromSettings(Environment env) {
177200
}
178201
return rulesReader;
179202
}
180-
181203
}

modules/analysis-common/src/test/java/org/opensearch/analysis/common/CommonAnalysisFactoryTests.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,16 @@
3939
import org.apache.lucene.analysis.snowball.SnowballPorterFilterFactory;
4040
import org.apache.lucene.analysis.te.TeluguNormalizationFilterFactory;
4141
import org.apache.lucene.analysis.te.TeluguStemFilterFactory;
42+
import org.opensearch.index.analysis.TokenFilterFactory;
4243
import org.opensearch.indices.analysis.AnalysisFactoryTestCase;
44+
import org.opensearch.indices.analysis.AnalysisModule;
4345

4446
import java.util.List;
4547
import java.util.Map;
4648
import java.util.TreeMap;
4749

50+
import org.mockito.Mock;
51+
4852
import static java.util.Collections.emptyList;
4953
import static java.util.stream.Collectors.toList;
5054

@@ -53,6 +57,9 @@ public CommonAnalysisFactoryTests() {
5357
super(new CommonAnalysisModulePlugin());
5458
}
5559

60+
@Mock
61+
private AnalysisModule analysisModule;
62+
5663
@Override
5764
protected Map<String, Class<?>> getTokenizers() {
5865
Map<String, Class<?>> tokenizers = new TreeMap<>(super.getTokenizers());
@@ -302,4 +309,19 @@ private void markedTestCase(String name, Map<String, Class<?>> map) {
302309
unmarked
303310
);
304311
}
312+
313+
/**
314+
* Tests the getTokenFilters(AnalysisModule) method to verify:
315+
* 1. All token filters are properly loaded
316+
* 2. Basic filters remain available
317+
* 3. Synonym filters remain available when AnalysisModule is provided
318+
*/
319+
public void testGetTokenFiltersWithAnalysisModule() {
320+
CommonAnalysisModulePlugin plugin = (CommonAnalysisModulePlugin) getAnalysisPlugin();
321+
Map<String, AnalysisModule.AnalysisProvider<TokenFilterFactory>> filters = plugin.getTokenFilters(analysisModule);
322+
assertNotNull("Token filters should not be null", filters);
323+
assertTrue("Should contain basic filters", filters.containsKey("lowercase"));
324+
assertTrue("Should contain synonym filter", filters.containsKey("synonym"));
325+
assertTrue("Should contain synonym_graph filter", filters.containsKey("synonym_graph"));
326+
}
305327
}

0 commit comments

Comments
 (0)