aditya-gupta36 commented on code in PR #356:
URL: https://github.com/apache/atlas/pull/356#discussion_r2464672603
##########
repository/src/main/java/org/apache/atlas/discovery/SearchProcessor.java:
##########
@@ -866,6 +871,10 @@ private boolean isIndexSearchable(FilterCriteria
filterCriteria, AtlasStructType
} else if (operator == SearchParameters.Operator.CONTAINS &&
AtlasAttribute.hastokenizeChar(attributeValue) && indexType == null) { //
indexType = TEXT
LOG.debug("{} operator found for string (TEXT) attribute
{} and special characters found in filter value {}, deferring to in-memory or
graph query (might cause poor performance)", operator, qualifiedName,
attributeValue);
+ ret = false;
+ } else if ((operator == SearchParameters.Operator.STARTS_WITH
|| operator == SearchParameters.Operator.ENDS_WITH || operator ==
SearchParameters.Operator.CONTAINS) && attributeValue.length() >
SOLR_MAX_TOKEN_STR_LENGTH) {
Review Comment:
Bypasses index for these operators when value length exceeds the limit.
Falls back to a graph traversal!
##########
common/src/main/java/org/apache/atlas/repository/Constants.java:
##########
@@ -152,6 +152,7 @@ public final class Constants {
public static final String INDEX_SEARCH_MAX_RESULT_SET_SIZE =
"atlas.graph.index.search.max-result-set-size";
public static final String INDEX_SEARCH_TYPES_MAX_QUERY_STR_LENGTH =
"atlas.graph.index.search.types.max-query-str-length";
public static final String INDEX_SEARCH_TAGS_MAX_QUERY_STR_LENGTH =
"atlas.graph.index.search.tags.max-query-str-length";
+ public static final String INDEX_SEARCH_SOLR_MAX_TOKEN_LENGTH =
"atlas.graph.solr.index.search.max-token-length";
Review Comment:
Adds a new configurable constant tied to Solr’s default maxTokenLen (255).
Useful for operators (STARTS_WITH, ENDS_WITH, CONTAINS) that can’t safely be
processed via the index when values exceed the token length.
Why this helps: avoids Solr truncation and allows search to fall back to the
graph safely on long values.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]