Commit 931d6efd by Sarath Subramanian

ATLAS-3826: Basic search not using index query for string tokenized attributes

parent 21b15842
......@@ -591,7 +591,7 @@ public class AtlasEntityType extends AtlasStructType {
return relationshipAttributes.containsKey(attributeName);
}
public String getQualifiedAttributeName(String attrName) throws AtlasBaseException {
public String getVertexPropertyName(String attrName) throws AtlasBaseException {
AtlasAttribute ret = getAttribute(attrName);
if (ret == null) {
......@@ -599,7 +599,7 @@ public class AtlasEntityType extends AtlasStructType {
}
if (ret != null) {
return ret.getQualifiedName();
return ret.getVertexPropertyName();
}
throw new AtlasBaseException(AtlasErrorCode.UNKNOWN_ATTRIBUTE, attrName, entityDef.getName());
......
......@@ -652,11 +652,11 @@ public class AtlasStructType extends AtlasType {
return null;
}
public String getQualifiedAttributeName(String attrName) throws AtlasBaseException {
public String getVertexPropertyName(String attrName) throws AtlasBaseException {
AtlasAttribute attribute = getAttribute(attrName);
if (attribute != null) {
return attribute.getQualifiedName();
return attribute.getVertexPropertyName();
}
throw new AtlasBaseException(AtlasErrorCode.UNKNOWN_ATTRIBUTE, attrName, structDef.getName());
......
......@@ -270,7 +270,7 @@ public abstract class SearchProcessor {
if (isIndexSearchable(filterCriteria, structType)) {
indexFiltered.add(attributeName);
} else {
LOG.warn("not using index-search for attribute '{}'; might cause poor performance", structType.getQualifiedAttributeName(attributeName));
LOG.warn("not using index-search for attribute '{}'; might cause poor performance", structType.getVertexPropertyName(attributeName));
graphFiltered.add(attributeName);
}
......@@ -437,7 +437,7 @@ public abstract class SearchProcessor {
}
private boolean isIndexSearchable(FilterCriteria filterCriteria, AtlasStructType structType) throws AtlasBaseException {
String qualifiedName = structType.getQualifiedAttributeName(filterCriteria.getAttributeName());
String qualifiedName = structType.getVertexPropertyName(filterCriteria.getAttributeName());
Set<String> indexedKeys = context.getIndexedKeys();
boolean ret = indexedKeys != null && indexedKeys.contains(qualifiedName);
......@@ -588,7 +588,7 @@ public abstract class SearchProcessor {
try {
if (OPERATOR_MAP.get(op) != null) {
String qualifiedName = type.getQualifiedAttributeName(attrName);
String qualifiedName = type.getVertexPropertyName(attrName);
String escapeIndexQueryValue = AtlasAttribute.escapeIndexQueryValue(attrVal);
// map '__customAttributes' 'CONTAINS' operator to 'EQ' operator (solr limitation for json serialized string search)
......
......@@ -75,7 +75,7 @@ class RegistryBasedLookup implements Lookup {
return "";
}
return et.getQualifiedAttributeName(name);
return et.getVertexPropertyName(name);
}
@Override
......
......@@ -619,7 +619,7 @@ public class AtlasGraphUtilsV2 {
if (ret) {
Set<String> indexSet = graph.getVertexIndexKeys();
try {
ret = indexSet.contains(entityType.getQualifiedAttributeName(attributeName));
ret = indexSet.contains(entityType.getVertexPropertyName(attributeName));
}
catch (AtlasBaseException ex) {
ret = false;
......
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