use of com.thinkbiganalytics.search.rest.model.SearchResult in project kylo by Teradata.
the class SearchFeedMetadataEsIT method verifySearchResultOnDescription3.
private void verifySearchResultOnDescription3(String term) {
Response response = given(SearchRestController.BASE).when().get("/?q=" + term);
response.then().statusCode(HTTP_OK);
SearchResult searchResult = response.as(SearchResult.class);
Assert.assertEquals("1", searchResult.getTotalHits().toString());
Assert.assertEquals("Description", searchResult.getSearchResults().get(0).getHighlights().get(0).getKey());
Assert.assertEquals("Sample feed for property search - Integration Test - <font style='font-weight:bold'>UPDATEDDESCRIPTION</font>", searchResult.getSearchResults().get(0).getHighlights().get(0).getValue());
}
use of com.thinkbiganalytics.search.rest.model.SearchResult in project kylo by Teradata.
the class SearchCategoryMetadataEsIT method verifySearchResultOnUserProperties2.
private void verifySearchResultOnUserProperties2(String term) {
Response response = given(SearchRestController.BASE).when().get("/?q=" + term);
response.then().statusCode(HTTP_OK);
SearchResult searchResult = response.as(SearchResult.class);
Assert.assertEquals("0", searchResult.getTotalHits().toString());
}
use of com.thinkbiganalytics.search.rest.model.SearchResult in project kylo by Teradata.
the class SearchCategoryMetadataEsIT method enableMetadataIndexingForFeedAndThenSearchAgain.
private void enableMetadataIndexingForFeedAndThenSearchAgain(String categoryId, String searchTermThatGivesResultsWhenIndexingIsOn) {
Response response = getCategoryById(categoryId);
FeedCategory feedCategory = response.as(FeedCategory.class);
Assert.assertFalse(feedCategory.isAllowIndexing());
feedCategory.setAllowIndexing(true);
createCategory(feedCategory);
waitForSomeTime(TEN_SECONDS_IN_MILLIS);
Response searchResponse = given(SearchRestController.BASE).when().get("/?q=" + searchTermThatGivesResultsWhenIndexingIsOn);
searchResponse.then().statusCode(HTTP_OK);
SearchResult searchResult = searchResponse.as(SearchResult.class);
verifyCommonPortionOfSearchResultOnCategory(searchResult, new HashSet<>(Collections.singletonList("User properties")));
String expected = "<table style='border:1px solid black; border-collapse: collapse;'>\n" + "<tr>\n" + "<td style='border:1px solid black;padding: 3px;'><font style='font-style:italic'>name</font></td>\n" + "<td style='border:1px solid black;padding: 3px;'><font style='font-style:italic'>value</font></td>\n" + "</tr>\n" + "<tr>\n" + "<td style='border:1px solid black;padding: 3px;'>\n" + "run mode</td style='border:1px solid black;padding: 3px;'>\n" + "<td style='border:1px solid black;padding: 3px;'>\n" + "AUTO i56 daily</td style='border:1px solid black;padding: 3px;'>\n" + "</tr>\n" + "<tr>\n" + "<td style='border:1px solid black;padding: 3px;'>\n" + "test type</td style='border:1px solid black;padding: 3px;'>\n" + "<td style='border:1px solid black;padding: 3px;'>\n" + "T100 <font style='font-weight:bold'>ad92</font></td style='border:1px solid black;padding: 3px;'>\n" + "</tr>\n" + "</table>";
Assert.assertEquals(expected, searchResult.getSearchResults().get(0).getHighlights().get(0).getValue());
}
use of com.thinkbiganalytics.search.rest.model.SearchResult in project kylo by Teradata.
the class SearchCategoryMetadataEsIT method verifySearchResultOnUserProperties1.
private void verifySearchResultOnUserProperties1(String term) {
Response response = given(SearchRestController.BASE).when().get("/?q=" + term);
response.then().statusCode(HTTP_OK);
SearchResult searchResult = response.as(SearchResult.class);
verifyCommonPortionOfSearchResultOnCategory(searchResult, new HashSet<>(Collections.singletonList("User properties")));
String expected = "<table style='border:1px solid black; border-collapse: collapse;'>\n" + "<tr>\n" + "<td style='border:1px solid black;padding: 3px;'><font style='font-style:italic'>name</font></td>\n" + "<td style='border:1px solid black;padding: 3px;'><font style='font-style:italic'>value</font></td>\n" + "</tr>\n" + "<tr>\n" + "<td style='border:1px solid black;padding: 3px;'>\n" + "run mode</td style='border:1px solid black;padding: 3px;'>\n" + "<td style='border:1px solid black;padding: 3px;'>\n" + "AUTO i56 daily</td style='border:1px solid black;padding: 3px;'>\n" + "</tr>\n" + "<tr>\n" + "<td style='border:1px solid black;padding: 3px;'>\n" + "test type</td style='border:1px solid black;padding: 3px;'>\n" + "<td style='border:1px solid black;padding: 3px;'>\n" + "T100 <font style='font-weight:bold'>ad92</font></td style='border:1px solid black;padding: 3px;'>\n" + "</tr>\n" + "</table>";
Assert.assertEquals(expected, searchResult.getSearchResults().get(0).getHighlights().get(0).getValue());
}
use of com.thinkbiganalytics.search.rest.model.SearchResult in project kylo by Teradata.
the class SearchCategoryMetadataEsIT method verifySearchResultOnDescription4.
private void verifySearchResultOnDescription4(String term) {
Response response = given(SearchRestController.BASE).when().get("/?q=" + term);
response.then().statusCode(HTTP_OK);
SearchResult searchResult = response.as(SearchResult.class);
Assert.assertEquals("0", searchResult.getTotalHits().toString());
}
Aggregations