Skip to content

Commit 7080a57

Browse files
committed
merged conflict
2 parents f57a793 + 03ba5b1 commit 7080a57

File tree

20 files changed

+419
-131
lines changed

20 files changed

+419
-131
lines changed

CONTRIBUTING.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -168,16 +168,13 @@ You can import the Elasticsearch project into IntelliJ IDEA via:
168168

169169
#### Checkstyle
170170

171-
If you have the [Checkstyle] plugin installed, you can configure IntelliJ to
172-
check the Elasticsearch code. However, the Checkstyle configuration file does
173-
not work by default with the IntelliJ plugin, so instead an IDE-specific config
174-
file is generated automatically after IntelliJ finishes syncing. You can
175-
manually generate the file with `./gradlew configureIdeCheckstyle` in case
176-
it is removed due to a `./gradlew clean` or other action.
177-
178-
IntelliJ should be automatically configured to use the generated rules after
179-
import via the `.idea/checkstyle-idea.xml` configuration file. No further
180-
action is required.
171+
IntelliJ should automatically configure checkstyle. It does so by running
172+
`configureIdeCheckstyle` on import. That makes `.idea/checkstyle-idea.xml`
173+
configuration file. IntelliJ points checkstyle at that.
174+
175+
Things like `./gradlew clean` or `git clean -xdf` can nuke the file. You can
176+
regenerate it by running `./gradlew -Didea.active=true configureIdeCheckstyle`,
177+
but generally shouldn't have to.
181178

182179
#### Formatting
183180

docs/changelog/129223.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 129223
2+
summary: Fix text similarity reranker does not propagate min score correctly
3+
area: Search
4+
type: bug
5+
issues: []

docs/changelog/129278.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 129278
2+
summary: Fix constant keyword optimization
3+
area: ES|QL
4+
type: bug
5+
issues: []

docs/changelog/129326.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 129326
2+
summary: Check positions on `MultiPhraseQueries` as well as phrase queries
3+
area: Search
4+
type: bug
5+
issues:
6+
- 123871

docs/reference/enrich-processor/normalize-for-stream.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ If the document is not OpenTelemetry-compliant, the processor normalizes it as f
4040
| `trace.id` | `trace_id` |
4141
| `message` | `body.text` |
4242
| `log.level` | `severity_text` |
43+
4344
The processor first looks for the nested form of the ECS field and if such does not exist, it looks for a top-level field with the dotted field name.
4445
* Other specific ECS fields that describe resources and have corresponding counterparts in the OpenTelemetry Semantic Conventions are moved to the `resource.attribtues` map. Fields that are considered resource attributes are such that conform to the following conditions:
4546
* They are ECS fields that have corresponding counterparts (either with

modules/analysis-common/src/yamlRestTest/resources/rest-api-spec/test/search.query/50_queries_with_synonyms.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,3 +200,50 @@
200200
query: quick brown
201201
operator: and
202202
- match: { hits.total: 2 }
203+
---
204+
# Tests that this returns 400, and not 500 (#123871)
205+
"Test multi_match phrase with no positions":
206+
- requires:
207+
cluster_features: [ "search.multi.match.checks.positions" ]
208+
reason: "This previously resulted in a 5xx error code"
209+
- do:
210+
indices.create:
211+
index: test
212+
body:
213+
settings:
214+
analysis:
215+
filter:
216+
syns:
217+
type: synonym
218+
synonyms: [ "quick,fast" ]
219+
analyzer:
220+
syns:
221+
tokenizer: standard
222+
filter: [ "syns" ]
223+
mappings:
224+
properties:
225+
field1:
226+
type: text
227+
index_options: freqs
228+
analyzer: syns
229+
230+
- do:
231+
index:
232+
index: test
233+
id: "1"
234+
body:
235+
field1: the quick brown fox
236+
237+
- do:
238+
catch: bad_request
239+
search:
240+
body:
241+
query:
242+
multi_match:
243+
query: the fast brown
244+
type: phrase
245+
fields:
246+
- field1
247+
- match: { status: 400 }
248+
- match: { error.root_cause.0.type: query_shard_exception }
249+
- match: { error.root_cause.0.reason: "failed to create query: field:[field1] was indexed without position data; cannot run MultiPhraseQuery" }

modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/extras/SearchAsYouTypeFieldMapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ public Query prefixQuery(
362362

363363
private void checkForPositions() {
364364
if (getTextSearchInfo().hasPositions() == false) {
365-
throw new IllegalStateException("field:[" + name() + "] was indexed without position data; cannot run PhraseQuery");
365+
throw new IllegalArgumentException("field:[" + name() + "] was indexed without position data; cannot run PhraseQuery");
366366
}
367367
}
368368

muted-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,9 @@ tests:
520520
- class: org.elasticsearch.xpack.esql.qa.single_node.GenerativeForkIT
521521
method: test {lookup-join.MultipleBatches*
522522
issue: https://github.com/elastic/elasticsearch/issues/129210
523+
- class: org.elasticsearch.xpack.autoscaling.storage.ReactiveStorageIT
524+
method: testScaleDuringSplitOrClone
525+
issue: https://github.com/elastic/elasticsearch/issues/129335
523526

524527
# Examples:
525528
#

server/src/internalClusterTest/java/org/elasticsearch/search/query/QueryStringIT.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,9 @@ public void testPhraseQueryOnFieldWithNoPositions() throws Exception {
178178
Exception.class,
179179
prepareSearch("test").setQuery(queryStringQuery("f4:\"eggplant parmesan\"").lenient(false))
180180
);
181-
IllegalStateException ise = (IllegalStateException) ExceptionsHelper.unwrap(exc, IllegalStateException.class);
182-
assertNotNull(ise);
183-
assertThat(ise.getMessage(), containsString("field:[f4] was indexed without position data; cannot run PhraseQuery"));
181+
IllegalArgumentException iae = (IllegalArgumentException) ExceptionsHelper.unwrap(exc, IllegalArgumentException.class);
182+
assertNotNull(iae);
183+
assertThat(iae.getMessage(), containsString("field:[f4] was indexed without position data; cannot run PhraseQuery"));
184184
}
185185

186186
public void testBooleanStrictQuery() throws Exception {

server/src/main/java/org/elasticsearch/common/lucene/search/CaseInsensitiveTermQuery.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ public CaseInsensitiveTermQuery(Term term) {
2828

2929
@Override
3030
public String toString(String field) {
31-
return this.getClass().getSimpleName() + "{" + field + ":" + term.text() + "}";
31+
StringBuilder buffer = new StringBuilder();
32+
buffer.append(getClass().getSimpleName());
33+
buffer.append('{');
34+
if (term.field().equals(field) == false) {
35+
buffer.append(term.field());
36+
buffer.append(':');
37+
}
38+
buffer.append(term.text());
39+
buffer.append('}');
40+
return buffer.toString();
3241
}
3342
}

0 commit comments

Comments
 (0)