-
Notifications
You must be signed in to change notification settings - Fork 25.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix line length offenders in the o.e.search package. #36223
Conversation
Pinging @elastic/es-core-infra |
297.1182, 299.4012, 300.6352, 302.1354, 304.1756, 306.1606, 307.3462, 308.5214, 309.4134, 310.8352, 313.9684, 315.837, | ||
316.7796, 318.9858, }, | ||
// precision 7 | ||
{ 92, 93.4934, 94.9758, 96.4574, 97.9718, 99.4954, 101.5302, 103.0756, 104.6374, 106.1782, 107.7888, 109.9522, 111.592, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hahahahahhaahahha
return Objects.equals(p, other.p) && | ||
Objects.equals(algorithm.get(bucket), other.algorithm.get(bucket)) && | ||
Objects.equals(getComparableData(bucket), other.getComparableData(bucket)); | ||
return Objects.equals(p, other.p) && Objects.equals(algorithm.get(bucket), other.algorithm.get(bucket)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you do these one per line?
@@ -90,7 +90,8 @@ protected void indexData() throws Exception { | |||
|
|||
indexRandom(true, docs); | |||
|
|||
SearchResponse resp = client().prepareSearch("idx").setTypes("type").setRouting(routing1).setQuery(matchAllQuery()).execute().actionGet(); | |||
SearchResponse resp = client().prepareSearch("idx").setTypes("type").setRouting(routing1).setQuery(matchAllQuery()).execute() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just use get
?
final int numSearches = scaledRandomIntBetween(10, 20); | ||
// we don't check anything here really just making sure we don't leave any open files or a broken index behind. | ||
for (int i = 0; i < numSearches; i++) { | ||
try { | ||
int docToQuery = between(0, numDocs - 1); | ||
int expectedResults = added[docToQuery] ? 1 : 0; | ||
logger.info("Searching for [test:{}]", English.intToEnglish(docToQuery)); | ||
SearchResponse searchResponse = client().prepareSearch().setTypes("type").setQuery(QueryBuilders.matchQuery("test", English.intToEnglish(docToQuery))) | ||
SearchResponse searchResponse = client().prepareSearch().setTypes("type") | ||
.setQuery(QueryBuilders.matchQuery("test", English.intToEnglish(docToQuery))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this indentation doesn't line up with the line under it which'll be confusing to read.
@@ -225,7 +229,8 @@ public void testCompleteLonRange() throws Exception { | |||
assertThat(searchResponse.getHits().getTotalHits(), equalTo(1L)); | |||
searchResponse = client().prepareSearch() | |||
.setQuery( | |||
geoBoundingBoxQuery("location").setValidationMethod(GeoValidationMethod.COERCE).setCorners(50, 0, -50, 360).type("indexed") | |||
geoBoundingBoxQuery("location").setValidationMethod(GeoValidationMethod.COERCE).setCorners(50, 0, -50, 360) | |||
.type("indexed") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having this line on the same indention of as the one that builds the object that it is poking doesn't quite feel right to me.
client().admin().cluster().prepareHealth().setWaitForEvents(Priority.LANGUID).setWaitForGreenStatus().execute().actionGet(); | ||
|
||
client().admin().cluster().prepareHealth().setWaitForEvents(Priority.LANGUID).setWaitForGreenStatus().execute().actionGet(); | ||
|
||
for (int i = 0; i < 100; i++) { | ||
client().prepareIndex("test", "type1", Integer.toString(i)).setSource(jsonBuilder().startObject().field("field", i).endObject()).execute().actionGet(); | ||
client().prepareIndex("test", "type1", Integer.toString(i)).setSource(jsonBuilder().startObject().field("field", i).endObject()) | ||
.execute().actionGet(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one doesn't look right.
@@ -1027,7 +1053,8 @@ public void testPrunedSegments() throws IOException { | |||
.field("somefield", "somevalue") | |||
.endObject() | |||
).get(); // we have 2 docs in a segment... | |||
ForceMergeResponse actionGet = client().admin().indices().prepareForceMerge().setFlush(true).setMaxNumSegments(1).execute().actionGet(); | |||
ForceMergeResponse actionGet = client().admin().indices().prepareForceMerge().setFlush(true).setMaxNumSegments(1).execute() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just call get
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for all that cleaning!
I'm sorry for your merge conflicts! |
No worries, that shouldn't be too hard to fix. Thanks for reviewing! |
I am not backporting this one to 6.x as there is a number of conflicts that make this change unsafe. An alternative would be to re-do the change on 6.x but it is very time-consuming. |
Relates #34884