|
73 | 73 | import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertNoFailures;
|
74 | 74 | import static org.opensearch.transport.client.Requests.createIndexRequest;
|
75 | 75 | import static org.opensearch.transport.client.Requests.searchRequest;
|
| 76 | +import static org.hamcrest.Matchers.containsString; |
76 | 77 | import static org.hamcrest.Matchers.equalTo;
|
77 | 78 | import static org.hamcrest.Matchers.instanceOf;
|
78 | 79 | import static org.hamcrest.Matchers.notNullValue;
|
@@ -179,12 +180,12 @@ public void testDfsQueryThenFetch() throws Exception {
|
179 | 180 | SearchHit hit = hits[i];
|
180 | 181 | assertThat(hit.getExplanation(), notNullValue());
|
181 | 182 | assertThat(hit.getExplanation().getDetails().length, equalTo(1));
|
182 |
| - assertThat(hit.getExplanation().getDetails()[0].getDetails().length, equalTo(3)); |
183 |
| - assertThat(hit.getExplanation().getDetails()[0].getDetails()[1].getDetails().length, equalTo(2)); |
184 |
| - assertThat(hit.getExplanation().getDetails()[0].getDetails()[1].getDetails()[0].getDescription(), startsWith("n,")); |
185 |
| - assertThat(hit.getExplanation().getDetails()[0].getDetails()[1].getDetails()[0].getValue(), equalTo(100L)); |
186 |
| - assertThat(hit.getExplanation().getDetails()[0].getDetails()[1].getDetails()[1].getDescription(), startsWith("N,")); |
187 |
| - assertThat(hit.getExplanation().getDetails()[0].getDetails()[1].getDetails()[1].getValue(), equalTo(100L)); |
| 183 | + assertThat(hit.getExplanation().getDetails()[0].getDetails().length, equalTo(2)); |
| 184 | + assertThat(hit.getExplanation().getDetails()[0].getDetails()[0].getDescription(), startsWith("idf")); |
| 185 | + assertThat(hit.getExplanation().getDetails()[0].getDetails()[0].getDetails().length, equalTo(2)); |
| 186 | + assertThat(hit.getExplanation().getDetails()[0].getDetails()[0].getDetails()[0].getValue(), equalTo(100L)); |
| 187 | + assertThat(hit.getExplanation().getDetails()[0].getDetails()[0].getDetails()[1].getValue(), equalTo(100L)); |
| 188 | + assertThat(hit.getExplanation().getDetails()[0].getDetails()[1].getDescription(), containsString("freq")); |
188 | 189 | assertThat(
|
189 | 190 | "id[" + hit.getId() + "] -> " + hit.getExplanation().toString(),
|
190 | 191 | hit.getId(),
|
@@ -221,12 +222,12 @@ public void testDfsQueryThenFetchWithSort() throws Exception {
|
221 | 222 | SearchHit hit = hits[i];
|
222 | 223 | assertThat(hit.getExplanation(), notNullValue());
|
223 | 224 | assertThat(hit.getExplanation().getDetails().length, equalTo(1));
|
224 |
| - assertThat(hit.getExplanation().getDetails()[0].getDetails().length, equalTo(3)); |
225 |
| - assertThat(hit.getExplanation().getDetails()[0].getDetails()[1].getDetails().length, equalTo(2)); |
226 |
| - assertThat(hit.getExplanation().getDetails()[0].getDetails()[1].getDetails()[0].getDescription(), startsWith("n,")); |
227 |
| - assertThat(hit.getExplanation().getDetails()[0].getDetails()[1].getDetails()[0].getValue(), equalTo(100L)); |
228 |
| - assertThat(hit.getExplanation().getDetails()[0].getDetails()[1].getDetails()[1].getDescription(), startsWith("N,")); |
229 |
| - assertThat(hit.getExplanation().getDetails()[0].getDetails()[1].getDetails()[1].getValue(), equalTo(100L)); |
| 225 | + assertThat(hit.getExplanation().getDetails()[0].getDetails().length, equalTo(2)); |
| 226 | + assertThat(hit.getExplanation().getDetails()[0].getDetails()[0].getDescription(), startsWith("idf")); |
| 227 | + assertThat(hit.getExplanation().getDetails()[0].getDetails()[0].getDetails().length, equalTo(2)); |
| 228 | + assertThat(hit.getExplanation().getDetails()[0].getDetails()[0].getDetails()[0].getValue(), equalTo(100L)); |
| 229 | + assertThat(hit.getExplanation().getDetails()[0].getDetails()[0].getDetails()[1].getValue(), equalTo(100L)); |
| 230 | + assertThat(hit.getExplanation().getDetails()[0].getDetails()[1].getDescription(), containsString("freq")); |
230 | 231 | assertThat("id[" + hit.getId() + "]", hit.getId(), equalTo(Integer.toString(total + i)));
|
231 | 232 | }
|
232 | 233 | total += hits.length;
|
|
0 commit comments