Skip to content

Conversation

waziqi89
Copy link
Contributor

@waziqi89 waziqi89 commented Apr 8, 2025

port the v0 stripped warming query code into v1.

Copy link
Member

@fragosoluana fragosoluana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that WarmerTest changes from v0.x weren't added in this PR, just double checking if this is intentional

@waziqi89
Copy link
Contributor Author

waziqi89 commented Apr 9, 2025

I noticed that WarmerTest changes from v0.x weren't added in this PR, just double checking if this is intentional

Forget to add it, let me fix this.

@waziqi89 waziqi89 requested a review from fragosoluana April 9, 2025 12:21
@waziqi89 waziqi89 requested a review from fragosoluana April 10, 2025 02:10
private List<String> getTestSearchRequestsAsJsonStrings() {
return List.of(
"{\"indexName\":\"test_index\",\"query\":{\"termQuery\":{\"field\":\"field0\"}}}",
"{\"indexName\":\"test_index\",\"query\":{\"termQuery\":{\"field\":\"field1\"}}}");
"{\"indexName\":\"test_index\",\"query\":{\"functionScoreQuery\":{\"query\":{\"termQuery\":{\"field\":\"field0\"}},\"script\":{\"lang\":\"js\",\"source\":\"3 * 5\"}}}}",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before we were testing the same query twice to test it being simplified or not. With the last commit change, we have 2 extra identical queries and I am just wondering what is being tested with these extra identical queries. Just wondering if we need them or if we can keep only two and simplify the test code by removing the extra for loops in getTestBasicSearchRequests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding 2 more lines to ensure the "random" works exactly as we expected. Only 2 queries might be coincident.

We ain't aiming to test the major stripping logic here

testRequests.add(searchRequest);
}

for (; i < 4; i++) {
Copy link
Member

@fragosoluana fragosoluana Apr 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor suggestion: use for (int i = 2; i < 4; i++) to be more clear that this for loop will add 2 requests. When I first read it quickly, I thought it was adding 4.

@waziqi89 waziqi89 merged commit 0b6d71a into Yelp:main Apr 11, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants