-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Add a Multi-Project Search Rest Test #128657
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
base: main
Are you sure you want to change the base?
Conversation
This commit adds a Rest IT specifically for search in MultiProject. Everything was already working as expected, but we were a bit light on explicit testing for search, which as _the_ core capability of Elasticsearch is worth testing thoroughly and clearly.
Pinging @elastic/es-search (Team:Search) |
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.
Thanks for the nice tests! Helpers make it super easy to read :).
"query": { "term": { "project": 1 } } | ||
} | ||
"""; | ||
results1 = getHitIds(search(projectId1, indexPrefix + "-*", query)); |
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.
Nit: maybe we should move getHitIds
into search(ProjectId projectId, String indexExpression, String body)
so we don't need to call it here?
results2 = search(projectId2, indexName); | ||
assertThat(results2, containsInAnyOrder(docId2a, docId2b)); | ||
|
||
results1 = search(projectId1, indexPrefix + "-*"); |
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.
Just curious - what's being tested with this final search?
// That is, an aggregation with size:0 | ||
ObjectPath response = search(projectId1, indexName, query); | ||
String context = "In search response: " + response; | ||
assertThat(response.evaluateArraySize("aggregations.proj.buckets"), equalTo(1)); |
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.
Did you mean to add context
to these assertions :)?
This commit adds a Rest IT specifically for search in MultiProject. Everything was already working as expected, but we were a bit light on explicit testing for search, which as the core capability of Elasticsearch is worth testing thoroughly and clearly.
Relates: ES-9352