Commit 204275cc by Damian Warszawski Committed by Madhan Neethiraj

ATLAS-3760: optimize freetext search handling of excludeDeletedEntities flag

parent b4246817
......@@ -57,6 +57,8 @@ public class FreeTextSearchProcessor extends SearchProcessor {
queryString.append(AND_STR).append(context.getEntityTypesQryStr());
}
graphIndexQueryBuilder.addActiveStateQueryFilter(queryString);
if (CollectionUtils.isNotEmpty(context.getClassificationTypes()) && context.getClassificationTypesQryStr().length() <= MAX_QUERY_STR_LENGTH_TYPES) {
queryString.append(AND_STR).append(context.getClassificationTypesQryStr());
}
......@@ -90,9 +92,8 @@ public class FreeTextSearchProcessor extends SearchProcessor {
}
try {
final int startIdx = context.getSearchParameters().getOffset();
final int limit = context.getSearchParameters().getLimit();
final boolean activeOnly = context.getSearchParameters().getExcludeDeletedEntities();
final int startIdx = context.getSearchParameters().getOffset();
final int limit = context.getSearchParameters().getLimit();
// query to start at 0, even though startIdx can be higher - because few results in earlier retrieval could
// have been dropped: like vertices of non-entity or non-active-entity
......@@ -137,10 +138,6 @@ public class FreeTextSearchProcessor extends SearchProcessor {
continue;
}
if (activeOnly && AtlasGraphUtilsV2.getState(vertex) != AtlasEntity.Status.ACTIVE) {
continue;
}
if (context.getClassificationType() != null) {
List<String> entityClassifications = GraphHelper.getAllTraitNames(vertex);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment