Search in sources :

Example 6 with SearchResult

use of com.thinkbiganalytics.search.rest.model.SearchResult in project kylo by Teradata.

the class SearchCategoryMetadataEsIT method verifySearchResultOnDescription1.

private void verifySearchResultOnDescription1(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("Description")));
    String expectedHighlightSubstring = "<font style='font-weight:bold'>Kylo</font> <font style='font-weight:bold'>Category</font> <font style='font-weight:bold'>Created</font> By Search Properties (<font style='font-weight:bold'>Category</font>) ES Integration Test";
    Assert.assertTrue(searchResult.getSearchResults().get(0).getHighlights().get(0).getValue().toString().contains(expectedHighlightSubstring));
}
Also used : Response(com.jayway.restassured.response.Response) SearchResult(com.thinkbiganalytics.search.rest.model.SearchResult)

Example 7 with SearchResult

use of com.thinkbiganalytics.search.rest.model.SearchResult in project kylo by Teradata.

the class SearchFeedMetadataEsIT 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());
}
Also used : Response(com.jayway.restassured.response.Response) SearchResult(com.thinkbiganalytics.search.rest.model.SearchResult)

Example 8 with SearchResult

use of com.thinkbiganalytics.search.rest.model.SearchResult in project kylo by Teradata.

the class SearchFeedMetadataEsIT method verifySearchResultOnDescription1.

private void verifySearchResultOnDescription1(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 - <font style='font-weight:bold'>Integration</font> <font style='font-weight:bold'>Test</font>", searchResult.getSearchResults().get(0).getHighlights().get(0).getValue());
}
Also used : Response(com.jayway.restassured.response.Response) SearchResult(com.thinkbiganalytics.search.rest.model.SearchResult)

Example 9 with SearchResult

use of com.thinkbiganalytics.search.rest.model.SearchResult in project kylo by Teradata.

the class SearchFeedMetadataEsIT method verifySearchResultOnDescription2.

private void verifySearchResultOnDescription2(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());
}
Also used : Response(com.jayway.restassured.response.Response) SearchResult(com.thinkbiganalytics.search.rest.model.SearchResult)

Example 10 with SearchResult

use of com.thinkbiganalytics.search.rest.model.SearchResult in project kylo by Teradata.

the class SearchFeedMetadataEsIT 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);
    Assert.assertEquals("1", searchResult.getTotalHits().toString());
    Assert.assertEquals("Description", searchResult.getSearchResults().get(0).getHighlights().get(0).getKey());
    Assert.assertEquals("Tags", searchResult.getSearchResults().get(0).getHighlights().get(1).getKey());
    Assert.assertEquals("Title", searchResult.getSearchResults().get(0).getHighlights().get(2).getKey());
    Assert.assertEquals("<font style='font-weight:bold'>Sample</font> <font style='font-weight:bold'>feed</font> <font style='font-weight:bold'>for</font> <font style='font-weight:bold'>property</font> <font style='font-weight:bold'>search</font> - Integration Test", searchResult.getSearchResults().get(0).getHighlights().get(0).getValue());
    Assert.assertEquals("<font style='font-weight:bold'>search</font> global <font style='font-weight:bold'>search</font> properties", searchResult.getSearchResults().get(0).getHighlights().get(1).getValue());
    Assert.assertEquals("<font style='font-weight:bold'>Sample</font>-<font style='font-weight:bold'>Feed</font>-<font style='font-weight:bold'>For</font>-<font style='font-weight:bold'>Property</font>-<font style='font-weight:bold'>Search</font>", searchResult.getSearchResults().get(0).getHighlights().get(2).getValue());
}
Also used : Response(com.jayway.restassured.response.Response) SearchResult(com.thinkbiganalytics.search.rest.model.SearchResult)

Aggregations

SearchResult (com.thinkbiganalytics.search.rest.model.SearchResult)30 Response (com.jayway.restassured.response.Response)26 SchemaSearchResultData (com.thinkbiganalytics.search.rest.model.SchemaSearchResultData)3 SearchResultData (com.thinkbiganalytics.search.rest.model.SearchResultData)3 TableSearchResultData (com.thinkbiganalytics.search.rest.model.TableSearchResultData)3 UnknownTypeSearchResultData (com.thinkbiganalytics.search.rest.model.UnknownTypeSearchResultData)3 ArrayList (java.util.ArrayList)3 FeedCategory (com.thinkbiganalytics.feedmgr.rest.model.FeedCategory)2 FeedMetadata (com.thinkbiganalytics.feedmgr.rest.model.FeedMetadata)2 CategoryMetadataSearchResultData (com.thinkbiganalytics.search.rest.model.CategoryMetadataSearchResultData)2 FeedMetadataSearchResultData (com.thinkbiganalytics.search.rest.model.FeedMetadataSearchResultData)2 RestResponseStatus (com.thinkbiganalytics.rest.model.RestResponseStatus)1 ElasticSearchRestSearchHit (com.thinkbiganalytics.search.rest.model.es.ElasticSearchRestSearchHit)1 ApiOperation (io.swagger.annotations.ApiOperation)1 ApiResponses (io.swagger.annotations.ApiResponses)1 HashMap (java.util.HashMap)1 Nonnull (javax.annotation.Nonnull)1 GET (javax.ws.rs.GET)1 Produces (javax.ws.rs.Produces)1 SolrDocument (org.apache.solr.common.SolrDocument)1