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