This is an automated email from the ASF dual-hosted git repository.
madhan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git
The following commit(s) were added to refs/heads/master by this push:
new 2c86bca ATLAS-3650: fixed incorrect results from basic-search for
types having large number of sub-types
2c86bca is described below
commit 2c86bcac2acbde694d1f98e47eb7a3c7bbd0dbce
Author: Pinal Shah <[email protected]>
AuthorDate: Mon Mar 16 18:10:33 2020 +0530
ATLAS-3650: fixed incorrect results from basic-search for types having
large number of sub-types
Signed-off-by: Madhan Neethiraj <[email protected]>
---
.../org/apache/atlas/discovery/EntitySearchProcessor.java | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git
a/repository/src/main/java/org/apache/atlas/discovery/EntitySearchProcessor.java
b/repository/src/main/java/org/apache/atlas/discovery/EntitySearchProcessor.java
index c9f3166..1a7bf6b 100644
---
a/repository/src/main/java/org/apache/atlas/discovery/EntitySearchProcessor.java
+++
b/repository/src/main/java/org/apache/atlas/discovery/EntitySearchProcessor.java
@@ -107,22 +107,19 @@ public class EntitySearchProcessor extends
SearchProcessor {
StringBuilder indexQuery = new StringBuilder();
+ // TypeName check to be done in-memory as well to address ATLAS-2121
(case sensitivity)
+ inMemoryPredicate = typeNamePredicate;
+
if (typeSearchByIndex) {
graphIndexQueryBuilder.addTypeAndSubTypesQueryFilter(indexQuery,
typeAndSubTypesQryStr);
-
- // TypeName check to be done in-memory as well to address
ATLAS-2121 (case sensitivity)
- inMemoryPredicate = typeNamePredicate;
-
}
if (attrSearchByIndex) {
constructFilterQuery(indexQuery, entityType, filterCriteria,
indexAttributes);
Predicate attributePredicate =
constructInMemoryPredicate(entityType, filterCriteria, indexAttributes);
- if (inMemoryPredicate != null) {
+ if (attributePredicate != null) {
inMemoryPredicate =
PredicateUtils.andPredicate(inMemoryPredicate, attributePredicate);
- } else {
- inMemoryPredicate = attributePredicate;
}
} else {
graphAttributes.addAll(indexAttributes);
@@ -314,9 +311,7 @@ public class EntitySearchProcessor extends SearchProcessor {
isLastResultPage = entityVertices.size() < limit;
// Do in-memory filtering
- if (inMemoryPredicate != null) {
- CollectionUtils.filter(entityVertices,
inMemoryPredicate);
- }
+ CollectionUtils.filter(entityVertices, inMemoryPredicate);
//incase when operator is NEQ in
pipeSeperatedSystemAttributes
if (graphQueryPredicate != null) {