private void validateSearchParameters(SearchParameters parameters) throws AtlasBaseException { if (parameters != null) { Servlets.validateQueryParamLength("typeName", parameters.getTypeName()); Servlets.validateQueryParamLength("classification", parameters.getClassification()); if (StringUtils.isNotEmpty(parameters.getQuery()) && parameters.getQuery().length() > maxFullTextQueryLength) { throw new AtlasBaseException(AtlasErrorCode.INVALID_QUERY_LENGTH, Constants.MAX_FULLTEXT_QUERY_STR_LENGTH); } } } }
if (StringUtils.isEmpty(parameters.getTypeName()) && !isEmpty(parameters.getEntityFilters())) { throw new AtlasBaseException(AtlasErrorCode.BAD_REQUEST, "EntityFilters specified without Type name"); if (StringUtils.isEmpty(parameters.getTypeName()) && StringUtils.isEmpty(parameters.getClassification()) && StringUtils.isEmpty(parameters.getQuery()) && StringUtils.isEmpty(parameters.getTermName())) { throw new AtlasBaseException(AtlasErrorCode.INVALID_SEARCH_PARAMS);
private AtlasSearchResult executeSavedSearch(AtlasUserSavedSearch savedSearch) throws AtlasBaseException { SearchParameters sp = savedSearch.getSearchParameters(); if(savedSearch.getSearchType() == AtlasUserSavedSearch.SavedSearchType.ADVANCED) { String dslQuery = atlasDiscoveryService.getDslQueryUsingTypeNameClassification(sp.getQuery(), sp.getTypeName(), sp.getClassification()); return atlasDiscoveryService.searchUsingDslQuery(dslQuery, sp.getLimit(), sp.getOffset()); } else { return atlasDiscoveryService.searchWithParameters(sp); } }
this.indexedKeys = indexedKeys; this.entityAttributes = new HashSet<>(); this.entityType = typeRegistry.getEntityTypeByName(searchParameters.getTypeName()); this.classificationType = getClassificationType(classificationName); if (StringUtils.isNotEmpty(searchParameters.getTypeName()) && entityType == null) { throw new AtlasBaseException(AtlasErrorCode.UNKNOWN_TYPENAME, searchParameters.getTypeName());