use of com.thinkbiganalytics.search.rest.model.SearchResult in project kylo by Teradata.
the class SearchCategoryMetadataEsIT method verifySearchResultOnTitle1.
private void verifySearchResultOnTitle1(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<>(Arrays.asList("Description", "Title")));
String expectedDescriptionHighlightSubstring = "Kylo Category Created By <font style='font-weight:bold'>Search</font> Properties (Category) ES Integration Test";
Assert.assertTrue(searchResult.getSearchResults().get(0).getHighlights().get(0).getValue().toString().contains(expectedDescriptionHighlightSubstring));
Assert.assertEquals("Cat <font style='font-weight:bold'>Search</font> <font style='font-weight:bold'>Prop</font> ES IT", searchResult.getSearchResults().get(0).getHighlights().get(1).getValue());
}
use of com.thinkbiganalytics.search.rest.model.SearchResult in project kylo by Teradata.
the class SearchCategoryMetadataEsIT method verifySearchResultOnUserProperties4.
private void verifySearchResultOnUserProperties4(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" + "<font style='font-weight:bold'>run</font> <font style='font-weight:bold'>mode</font></td style='border:1px solid black;padding: 3px;'>\n" + "<td style='border:1px solid black;padding: 3px;'>\n" + "<font style='font-weight:bold'>AUTO</font> 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 ad92</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 SearchFeedMetadataEsIT method verifySearchResultOnUserProperties5.
private void verifySearchResultOnUserProperties5(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 SearchFeedMetadataEsIT method disableMetadataIndexingForFeedAndThenSearchAgain.
private void disableMetadataIndexingForFeedAndThenSearchAgain(String feedId) {
Response response = getFeedById(feedId);
FeedMetadata feedMetadata = response.as(FeedMetadata.class);
Assert.assertTrue(feedMetadata.isAllowIndexing());
feedMetadata.setAllowIndexing(false);
createFeed(feedMetadata);
String term = "Bb2000y";
Response searchResponse = given(SearchRestController.BASE).when().get("/?q=" + term);
searchResponse.then().statusCode(HTTP_OK);
SearchResult searchResult = searchResponse.as(SearchResult.class);
Assert.assertEquals("0", searchResult.getTotalHits().toString());
}
use of com.thinkbiganalytics.search.rest.model.SearchResult in project kylo by Teradata.
the class SearchFeedMetadataEsIT method verifySearchResultOnTags1.
private void verifySearchResultOnTags1(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("Tags", searchResult.getSearchResults().get(0).getHighlights().get(0).getKey());
Assert.assertEquals("search <font style='font-weight:bold'>global</font> search properties", searchResult.getSearchResults().get(0).getHighlights().get(0).getValue());
}
Aggregations