use of org.apache.atlas.model.discovery.QuickSearchParameters in project atlas by apache.
the class AtlasDiscoveryServiceTest method specialCharQuickSearchAssertQFName.
@Test(dataProvider = "specialCharSearchQFName")
public void specialCharQuickSearchAssertQFName(String attrName, SearchParameters.Operator operator, String attrValue, int expected) throws AtlasBaseException {
QuickSearchParameters params = new QuickSearchParameters();
params.setTypeName(HIVE_TABLE_TYPE);
SearchParameters.FilterCriteria filterCriteria = getSingleFilterCondition(attrName, operator, attrValue);
params.setEntityFilters(filterCriteria);
params.setLimit(20);
AtlasQuickSearchResult searchResult = discoveryService.quickSearch(params);
assertSearchResult(searchResult.getSearchResults(), expected, attrValue);
if (expected > 0) {
assertAggregationMetrics(searchResult);
}
}
use of org.apache.atlas.model.discovery.QuickSearchParameters in project atlas by apache.
the class AtlasDiscoveryServiceTest method specialCharQuickSearch.
@Test(dataProvider = "specialCharQuickSearch")
public void specialCharQuickSearch(String searchValue, int expected) throws AtlasBaseException {
QuickSearchParameters params = new QuickSearchParameters();
params.setQuery(searchValue);
params.setLimit(5);
params.setOffset(0);
AtlasQuickSearchResult searchResult = discoveryService.quickSearch(params);
assertSearchResult(searchResult.getSearchResults(), expected, searchValue);
if (expected > 0) {
assertAggregationMetrics(searchResult);
}
}
use of org.apache.atlas.model.discovery.QuickSearchParameters in project atlas by apache.
the class AtlasDiscoveryServiceTest method specialCharQuickSearchAssertName.
@Test(dataProvider = "specialCharSearchName")
public void specialCharQuickSearchAssertName(String attrName, SearchParameters.Operator operator, String attrValue, int expected) throws AtlasBaseException {
QuickSearchParameters params = new QuickSearchParameters();
params.setTypeName(HIVE_TABLE_TYPE);
SearchParameters.FilterCriteria filterCriteria = getSingleFilterCondition(attrName, operator, attrValue);
params.setEntityFilters(filterCriteria);
params.setLimit(20);
AtlasQuickSearchResult searchResult = discoveryService.quickSearch(params);
assertSearchResult(searchResult.getSearchResults(), expected, attrValue);
if (expected > 0) {
assertAggregationMetrics(searchResult);
}
}
use of org.apache.atlas.model.discovery.QuickSearchParameters in project atlas by apache.
the class EntityDiscoveryService method createSearchParameters.
public static SearchParameters createSearchParameters(QuickSearchParameters quickSearchParameters) {
SearchParameters searchParameters = new SearchParameters();
searchParameters.setQuery(quickSearchParameters.getQuery());
searchParameters.setTypeName(quickSearchParameters.getTypeName());
searchParameters.setExcludeDeletedEntities(quickSearchParameters.getExcludeDeletedEntities());
searchParameters.setIncludeSubTypes(quickSearchParameters.getIncludeSubTypes());
searchParameters.setLimit(quickSearchParameters.getLimit());
searchParameters.setOffset(quickSearchParameters.getOffset());
searchParameters.setEntityFilters(quickSearchParameters.getEntityFilters());
searchParameters.setAttributes(quickSearchParameters.getAttributes());
searchParameters.setSortBy(quickSearchParameters.getSortBy());
searchParameters.setSortOrder(quickSearchParameters.getSortOrder());
return searchParameters;
}
use of org.apache.atlas.model.discovery.QuickSearchParameters in project atlas by apache.
the class BasicSearchIT method testPostQuickSearch.
@Test
public void testPostQuickSearch() {
try {
QuickSearchParameters quickSearchParameters = new QuickSearchParameters();
quickSearchParameters.setQuery("test");
quickSearchParameters.setTypeName("hdfs_path");
AtlasQuickSearchResult result = atlasClientV2.quickSearch(quickSearchParameters);
List<AtlasEntityHeader> list = result.getSearchResults().getEntities();
assertEquals(list.size(), 1);
} catch (AtlasServiceException e) {
fail(e.getMessage());
}
}
Aggregations