Skip to content

Commit b2a8b64

Browse files
committed
Update template_id values after seed change
1 parent 0fe4b4a commit b2a8b64

File tree

3 files changed

+22
-23
lines changed

3 files changed

+22
-23
lines changed

x-pack/plugin/logsdb/src/test/java/org/elasticsearch/xpack/logsdb/patternedtext/PatternedTextFieldMapperTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public void testDefaults() throws IOException {
154154
{
155155
List<IndexableField> fields = doc.rootDoc().getFields("field.template_id");
156156
assertEquals(1, fields.size());
157-
assertEquals("GP1QUa-gBfg", fields.get(0).binaryValue().utf8ToString());
157+
assertEquals("D3OycqSEnDM", fields.get(0).binaryValue().utf8ToString());
158158
IndexableFieldType fieldType = fields.get(0).fieldType();
159159
assertThat(fieldType.omitNorms(), equalTo(true));
160160
assertFalse(fieldType.tokenized());

x-pack/plugin/logsdb/src/test/java/org/elasticsearch/xpack/logsdb/patternedtext/PatternedTextValueProcessorTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public void testWithTimestamp1() {
106106
public void testTemplateIdIsExpectedShape() {
107107
String text = "[2020-08-18T00:58:56] Found 123 errors for service [cheddar1]";
108108
PatternedTextValueProcessor.Parts parts = PatternedTextValueProcessor.split(text);
109-
assertEquals("vznUCMiok3s", parts.templateId());
109+
assertEquals("vSr1YMYPups", parts.templateId());
110110
}
111111

112112
public void testTemplateIdHasVeryFewCollisions() {

x-pack/plugin/logsdb/src/yamlRestTest/resources/rest-api-spec/test/patternedtext/30_template_id.yml

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Field caps:
5656
- match: { fields: {"foo.template_id": {"keyword": {"type": "keyword", "metadata_field": false, "searchable": true, "aggregatable": true}}}}
5757

5858
---
59-
Search by template_id:
59+
Get template_id field:
6060

6161
- do:
6262
search:
@@ -68,7 +68,7 @@ Search by template_id:
6868
values: ["2"]
6969

7070
- match: { hits.total.value: 1 }
71-
- match: { hits.hits.0.fields: {"foo.template_id": ["r_pSgUThjqM"]} }
71+
- match: { hits.hits.0.fields: {"foo.template_id": ["iJEgF75EQNk"]} }
7272

7373
---
7474
Sort by template_id:
@@ -82,13 +82,13 @@ Sort by template_id:
8282
query: {match_all: {} }
8383

8484
- match: { hits.total.value: 5 }
85-
- match: { hits.hits.0.fields: {"foo.template_id": ["aIZhSjsVbIg"]} }
86-
- match: { hits.hits.0._id: "4" }
87-
- match: { hits.hits.1.fields: {"foo.template_id": ["r_pSgUThjqM"]} }
88-
- match: { hits.hits.1._id: "2" }
89-
- match: { hits.hits.2.fields: {"foo.template_id": ["r_pSgUThjqM"]} }
90-
- match: { hits.hits.2._id: "5" }
91-
- match: { hits.hits.3.fields: {"foo.template_id": ["vznUCMiok3s"]} }
85+
- match: { hits.hits.0.fields: {"foo.template_id": ["iJEgF75EQNk"]} }
86+
- match: { hits.hits.0._id: "2" }
87+
- match: { hits.hits.1.fields: {"foo.template_id": ["iJEgF75EQNk"]} }
88+
- match: { hits.hits.1._id: "5" }
89+
- match: { hits.hits.2.fields: {"foo.template_id": ["k-2qtjujOCw"]} }
90+
- match: { hits.hits.2._id: "4" }
91+
- match: { hits.hits.3.fields: {"foo.template_id": ["vSr1YMYPups"]} }
9292
- match: { hits.hits.3._id: "3" }
9393
- match: { hits.hits.4.fields: null }
9494
- match: { hits.hits.4._id: "1" }
@@ -117,7 +117,7 @@ Match query:
117117
body:
118118
query:
119119
match:
120-
foo.template_id: "r_pSgUThjqM"
120+
foo.template_id: "iJEgF75EQNk"
121121

122122
- match: { hits.total.value: 2 }
123123
- match: { hits.hits.0._score: 1.0 }
@@ -132,12 +132,11 @@ Range query:
132132
query:
133133
range:
134134
foo.template_id:
135-
gt: "b"
136-
# one doc has a null value for template_id and one starts with a
137-
- match: { hits.total.value: 3 }
138-
- match: { hits.hits.0._id: "2" }
139-
- match: { hits.hits.1._id: "3" }
140-
- match: { hits.hits.2._id: "5" }
135+
gt: "j"
136+
# one doc has a null value for template_id and two start with i < j
137+
- match: { hits.total.value: 2 }
138+
- match: { hits.hits.0._id: "3" }
139+
- match: { hits.hits.1._id: "4" }
141140

142141
---
143142
Term aggregation:
@@ -154,11 +153,11 @@ Term aggregation:
154153

155154
- match: { hits.total.value: 5 }
156155
- length: { aggregations.template_id_agg.buckets: 3 }
157-
- match: { aggregations.template_id_agg.buckets.0.key: "aIZhSjsVbIg" }
158-
- match: { aggregations.template_id_agg.buckets.0.doc_count: 1 }
159-
- match: { aggregations.template_id_agg.buckets.1.key: "r_pSgUThjqM" }
160-
- match: { aggregations.template_id_agg.buckets.1.doc_count: 2 }
161-
- match: { aggregations.template_id_agg.buckets.2.key: "vznUCMiok3s" }
156+
- match: { aggregations.template_id_agg.buckets.0.key: "iJEgF75EQNk" }
157+
- match: { aggregations.template_id_agg.buckets.0.doc_count: 2 }
158+
- match: { aggregations.template_id_agg.buckets.1.key: "k-2qtjujOCw" }
159+
- match: { aggregations.template_id_agg.buckets.1.doc_count: 1 }
160+
- match: { aggregations.template_id_agg.buckets.2.key: "vSr1YMYPups" }
162161
- match: { aggregations.template_id_agg.buckets.2.doc_count: 1 }
163162

164163

0 commit comments

Comments
 (0)