Repository: atlas Updated Branches: refs/heads/master f86603a8a -> 3654f9fc3
ATLAS-2849: Basic search result list for classification= '_NOT_CLASSIFIED' returns type vertices in addition to matching entity vertices Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/3654f9fc Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/3654f9fc Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/3654f9fc Branch: refs/heads/master Commit: 3654f9fc36dee5355b7aa46d07adaef0abcc4f4f Parents: f86603a Author: Sarath Subramanian <[email protected]> Authored: Wed Aug 29 16:41:37 2018 -0700 Committer: Sarath Subramanian <[email protected]> Committed: Wed Aug 29 16:41:37 2018 -0700 ---------------------------------------------------------------------- .../apache/atlas/discovery/ClassificationSearchProcessor.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/atlas/blob/3654f9fc/repository/src/main/java/org/apache/atlas/discovery/ClassificationSearchProcessor.java ---------------------------------------------------------------------- diff --git a/repository/src/main/java/org/apache/atlas/discovery/ClassificationSearchProcessor.java b/repository/src/main/java/org/apache/atlas/discovery/ClassificationSearchProcessor.java index c00bfb6..1cd507c 100644 --- a/repository/src/main/java/org/apache/atlas/discovery/ClassificationSearchProcessor.java +++ b/repository/src/main/java/org/apache/atlas/discovery/ClassificationSearchProcessor.java @@ -53,6 +53,8 @@ import java.util.Set; import static org.apache.atlas.discovery.SearchContext.MATCH_ALL_CLASSIFIED; import static org.apache.atlas.discovery.SearchContext.MATCH_ALL_NOT_CLASSIFIED; import static org.apache.atlas.discovery.SearchContext.MATCH_ALL_WILDCARD_CLASSIFICATION; +import static org.apache.atlas.repository.Constants.ENTITY_TYPE_PROPERTY_KEY; +import static org.apache.atlas.repository.Constants.GUID_PROPERTY_KEY; import static org.apache.atlas.repository.Constants.PROPAGATED_TRAIT_NAMES_PROPERTY_KEY; import static org.apache.atlas.repository.Constants.TRAIT_NAMES_PROPERTY_KEY; import static org.apache.atlas.repository.graphdb.AtlasGraphQuery.ComparisionOperator.EQUAL; @@ -169,7 +171,8 @@ public class ClassificationSearchProcessor extends SearchProcessor { SearchPredicateUtil.getNotEmptyPredicateGenerator().generatePredicate(TRAIT_NAMES_PROPERTY_KEY, null, List.class), SearchPredicateUtil.getNotEmptyPredicateGenerator().generatePredicate(PROPAGATED_TRAIT_NAMES_PROPERTY_KEY, null, List.class)); } else if (classificationType == MATCH_ALL_NOT_CLASSIFIED) { - orConditions.add(graph.query().createChildQuery().has(TRAIT_NAMES_PROPERTY_KEY, EQUAL, null).has(PROPAGATED_TRAIT_NAMES_PROPERTY_KEY, EQUAL, null)); + orConditions.add(graph.query().createChildQuery().has(GUID_PROPERTY_KEY, NOT_EQUAL, null).has(ENTITY_TYPE_PROPERTY_KEY, NOT_EQUAL, null) + .has(TRAIT_NAMES_PROPERTY_KEY, EQUAL, null).has(PROPAGATED_TRAIT_NAMES_PROPERTY_KEY, EQUAL, null)); entityGraphQueryTraitNames = graph.query().or(orConditions); entityPredicateTraitNames = PredicateUtils.andPredicate(
