Skip to content

Commit 4f2c4c2

Browse files
Merge branch 'main' into fix/es-10981
2 parents a32d3cd + b917d9a commit 4f2c4c2

File tree

101 files changed

+4357
-2954
lines changed

Some content is hidden

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

101 files changed

+4357
-2954
lines changed

benchmarks/src/main/java/org/elasticsearch/benchmark/vector/VectorScorerBenchmark.java

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import org.apache.lucene.store.MMapDirectory;
2020
import org.apache.lucene.util.hnsw.RandomVectorScorer;
2121
import org.apache.lucene.util.hnsw.RandomVectorScorerSupplier;
22+
import org.apache.lucene.util.hnsw.UpdateableRandomVectorScorer;
2223
import org.apache.lucene.util.quantization.QuantizedByteVectorValues;
2324
import org.apache.lucene.util.quantization.ScalarQuantizer;
2425
import org.elasticsearch.common.logging.LogConfigurator;
@@ -76,10 +77,10 @@ public class VectorScorerBenchmark {
7677
float vec2Offset;
7778
float scoreCorrectionConstant;
7879

79-
RandomVectorScorer luceneDotScorer;
80-
RandomVectorScorer luceneSqrScorer;
81-
RandomVectorScorer nativeDotScorer;
82-
RandomVectorScorer nativeSqrScorer;
80+
UpdateableRandomVectorScorer luceneDotScorer;
81+
UpdateableRandomVectorScorer luceneSqrScorer;
82+
UpdateableRandomVectorScorer nativeDotScorer;
83+
UpdateableRandomVectorScorer nativeSqrScorer;
8384

8485
RandomVectorScorer luceneDotScorerQuery;
8586
RandomVectorScorer nativeDotScorerQuery;
@@ -118,12 +119,16 @@ public void setup() throws IOException {
118119
in = dir.openInput("vector.data", IOContext.DEFAULT);
119120
var values = vectorValues(dims, 2, in, VectorSimilarityFunction.DOT_PRODUCT);
120121
scoreCorrectionConstant = values.getScalarQuantizer().getConstantMultiplier();
121-
luceneDotScorer = luceneScoreSupplier(values, VectorSimilarityFunction.DOT_PRODUCT).scorer(0);
122+
luceneDotScorer = luceneScoreSupplier(values, VectorSimilarityFunction.DOT_PRODUCT).scorer();
123+
luceneDotScorer.setScoringOrdinal(0);
122124
values = vectorValues(dims, 2, in, VectorSimilarityFunction.EUCLIDEAN);
123-
luceneSqrScorer = luceneScoreSupplier(values, VectorSimilarityFunction.EUCLIDEAN).scorer(0);
125+
luceneSqrScorer = luceneScoreSupplier(values, VectorSimilarityFunction.EUCLIDEAN).scorer();
126+
luceneSqrScorer.setScoringOrdinal(0);
124127

125-
nativeDotScorer = factory.getInt7SQVectorScorerSupplier(DOT_PRODUCT, in, values, scoreCorrectionConstant).get().scorer(0);
126-
nativeSqrScorer = factory.getInt7SQVectorScorerSupplier(EUCLIDEAN, in, values, scoreCorrectionConstant).get().scorer(0);
128+
nativeDotScorer = factory.getInt7SQVectorScorerSupplier(DOT_PRODUCT, in, values, scoreCorrectionConstant).get().scorer();
129+
nativeDotScorer.setScoringOrdinal(0);
130+
nativeSqrScorer = factory.getInt7SQVectorScorerSupplier(EUCLIDEAN, in, values, scoreCorrectionConstant).get().scorer();
131+
nativeSqrScorer.setScoringOrdinal(0);
127132

128133
// setup for getInt7SQVectorScorer / query vector scoring
129134
float[] queryVec = new float[dims];

build-tools-internal/version.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
elasticsearch = 9.1.0
2-
lucene = 10.1.0
2+
lucene = 10.2.0
33

44
bundled_jdk_vendor = openjdk
55
bundled_jdk = 24+36@1f9ff9062db4449d8ca828c504ffae90
@@ -8,7 +8,7 @@ spatial4j = 0.7
88
jts = 1.15.0
99
jackson = 2.15.0
1010
snakeyaml = 2.0
11-
icu4j = 68.2
11+
icu4j = 77.1
1212
supercsv = 2.4.0
1313
log4j = 2.19.0
1414
slf4j = 2.0.6

distribution/tools/keystore-cli/src/main/java/org/elasticsearch/cli/keystore/AddStringKeyStoreCommand.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,10 @@
1919
import org.elasticsearch.core.CheckedFunction;
2020
import org.elasticsearch.env.Environment;
2121

22-
import java.io.BufferedReader;
2322
import java.io.CharArrayWriter;
2423
import java.io.Closeable;
2524
import java.io.IOException;
26-
import java.io.InputStream;
27-
import java.io.InputStreamReader;
28-
import java.nio.charset.StandardCharsets;
25+
import java.io.Reader;
2926
import java.util.Arrays;
3027
import java.util.List;
3128

@@ -47,11 +44,6 @@ class AddStringKeyStoreCommand extends BaseKeyStoreCommand {
4744
this.arguments = parser.nonOptions("setting names");
4845
}
4946

50-
// pkg private so tests can manipulate
51-
InputStream getStdin() {
52-
return System.in;
53-
}
54-
5547
@Override
5648
protected void executeCommand(Terminal terminal, OptionSet options, Environment env) throws Exception {
5749
final List<String> settings = arguments.values(options);
@@ -64,7 +56,7 @@ protected void executeCommand(Terminal terminal, OptionSet options, Environment
6456
final Closeable closeable;
6557
final CheckedFunction<String, char[], IOException> valueSupplier;
6658
if (options.has(stdinOption)) {
67-
final BufferedReader stdinReader = new BufferedReader(new InputStreamReader(getStdin(), StandardCharsets.UTF_8));
59+
final Reader stdinReader = terminal.getReader();
6860
valueSupplier = s -> {
6961
try (CharArrayWriter writer = new CharArrayWriter()) {
7062
int c;

distribution/tools/keystore-cli/src/test/java/org/elasticsearch/cli/keystore/AddStringKeyStoreCommandTests.java

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,30 +18,20 @@
1818
import org.elasticsearch.common.settings.KeyStoreWrapper;
1919
import org.elasticsearch.env.Environment;
2020

21-
import java.io.ByteArrayInputStream;
2221
import java.io.CharArrayWriter;
23-
import java.io.InputStream;
24-
import java.nio.charset.StandardCharsets;
2522

2623
import static org.hamcrest.Matchers.anyOf;
2724
import static org.hamcrest.Matchers.containsString;
2825
import static org.hamcrest.Matchers.hasToString;
2926

3027
public class AddStringKeyStoreCommandTests extends KeyStoreCommandTestCase {
31-
InputStream input;
32-
3328
@Override
3429
protected Command newCommand() {
3530
return new AddStringKeyStoreCommand() {
3631
@Override
3732
protected Environment createEnv(OptionSet options, ProcessInfo processInfo) throws UserException {
3833
return env;
3934
}
40-
41-
@Override
42-
InputStream getStdin() {
43-
return input;
44-
}
4535
};
4636
}
4737

@@ -167,7 +157,7 @@ public void testStdinShort() throws Exception {
167157
String password = "keystorepassword";
168158
KeyStoreWrapper.create().save(env.configDir(), password.toCharArray());
169159
terminal.addSecretInput(password);
170-
setInput("secret value 1");
160+
terminal.addSecretInput("secret value 1");
171161
execute("-x", "foo");
172162
assertSecureString("foo", "secret value 1", password);
173163
}
@@ -176,7 +166,7 @@ public void testStdinLong() throws Exception {
176166
String password = "keystorepassword";
177167
KeyStoreWrapper.create().save(env.configDir(), password.toCharArray());
178168
terminal.addSecretInput(password);
179-
setInput("secret value 2");
169+
terminal.addSecretInput("secret value 2");
180170
execute("--stdin", "foo");
181171
assertSecureString("foo", "secret value 2", password);
182172
}
@@ -185,7 +175,7 @@ public void testStdinNoInput() throws Exception {
185175
String password = "keystorepassword";
186176
KeyStoreWrapper.create().save(env.configDir(), password.toCharArray());
187177
terminal.addSecretInput(password);
188-
setInput("");
178+
terminal.addSecretInput("");
189179
execute("-x", "foo");
190180
assertSecureString("foo", "", password);
191181
}
@@ -194,7 +184,7 @@ public void testStdinInputWithLineBreaks() throws Exception {
194184
String password = "keystorepassword";
195185
KeyStoreWrapper.create().save(env.configDir(), password.toCharArray());
196186
terminal.addSecretInput(password);
197-
setInput("Typedthisandhitenter\n");
187+
terminal.addSecretInput("Typedthisandhitenter\n");
198188
execute("-x", "foo");
199189
assertSecureString("foo", "Typedthisandhitenter", password);
200190
}
@@ -203,7 +193,7 @@ public void testStdinInputWithCarriageReturn() throws Exception {
203193
String password = "keystorepassword";
204194
KeyStoreWrapper.create().save(env.configDir(), password.toCharArray());
205195
terminal.addSecretInput(password);
206-
setInput("Typedthisandhitenter\r");
196+
terminal.addSecretInput("Typedthisandhitenter\r");
207197
execute("-x", "foo");
208198
assertSecureString("foo", "Typedthisandhitenter", password);
209199
}
@@ -212,7 +202,9 @@ public void testStdinWithMultipleValues() throws Exception {
212202
final String password = "keystorepassword";
213203
KeyStoreWrapper.create().save(env.configDir(), password.toCharArray());
214204
terminal.addSecretInput(password);
215-
setInput("bar1\nbar2\nbar3");
205+
terminal.addSecretInput("bar1");
206+
terminal.addSecretInput("bar2");
207+
terminal.addSecretInput("bar3");
216208
execute(randomFrom("-x", "--stdin"), "foo1", "foo2", "foo3");
217209
assertSecureString("foo1", "bar1", password);
218210
assertSecureString("foo2", "bar2", password);
@@ -228,7 +220,7 @@ public void testAddUtf8String() throws Exception {
228220
for (int i = 0; i < stringSize; i++) {
229221
secretChars.write((char) randomIntBetween(129, 2048));
230222
}
231-
setInput(secretChars.toString());
223+
terminal.addSecretInput(secretChars.toString());
232224
execute("-x", "foo");
233225
assertSecureString("foo", secretChars.toString(), password);
234226
}
@@ -265,8 +257,4 @@ public void testAddToUnprotectedKeystore() throws Exception {
265257
execute("foo");
266258
assertSecureString("foo", "bar", password);
267259
}
268-
269-
void setInput(String inputStr) {
270-
input = new ByteArrayInputStream(inputStr.getBytes(StandardCharsets.UTF_8));
271-
}
272260
}

docs/Versions.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

22
include::{docs-root}/shared/versions/stack/{source_branch}.asciidoc[]
33

4-
:lucene_version: 10.1.0
5-
:lucene_version_path: 10_1_0
4+
:lucene_version: 10.2.0
5+
:lucene_version_path: 10_2_0
66
:jdk: 11.0.2
77
:jdk_major: 11
88
:build_type: tar

docs/changelog/125517.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 125517
2+
summary: Semantic Text Chunking Indexing Pressure
3+
area: Machine Learning
4+
type: enhancement
5+
issues: []

docs/changelog/126594.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 126594
2+
summary: Upgrade to Lucene 10.2.0
3+
area: Search
4+
type: upgrade
5+
issues: []

docs/changelog/126729.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 126729
2+
summary: Use terminal reader in keystore add command
3+
area: Infra/CLI
4+
type: bug
5+
issues:
6+
- 98115

docs/changelog/126778.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 126778
2+
summary: Fix bbq quantization algorithm but for differently distributed components
3+
area: Vector Search
4+
type: bug
5+
issues: []

docs/changelog/126792.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 126792
2+
summary: Revert endpoint creation validation for ELSER and E5
3+
area: Machine Learning
4+
type: bug
5+
issues: []

0 commit comments

Comments
 (0)