Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dataplatform
atlas
Commits
a785e935
Commit
a785e935
authored
Sep 06, 2017
by
apoorvnaik
Committed by
Madhan Neethiraj
Sep 14, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-2118: basic search fix - incorrect results for contains operator
Signed-off-by:
Madhan Neethiraj
<
madhan@apache.org
>
parent
13fed7a9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
1 deletion
+29
-1
SearchProcessor.java
...main/java/org/apache/atlas/discovery/SearchProcessor.java
+29
-1
No files found.
repository/src/main/java/org/apache/atlas/discovery/SearchProcessor.java
View file @
a785e935
...
@@ -220,6 +220,8 @@ public abstract class SearchProcessor {
...
@@ -220,6 +220,8 @@ public abstract class SearchProcessor {
}
}
}
else
if
(
StringUtils
.
isNotEmpty
(
filterCriteria
.
getAttributeName
()))
{
}
else
if
(
StringUtils
.
isNotEmpty
(
filterCriteria
.
getAttributeName
()))
{
try
{
try
{
if
(
insideOrCondition
&&
!
isIndexSearchable
(
filterCriteria
,
structType
))
{
if
(
insideOrCondition
&&
!
isIndexSearchable
(
filterCriteria
,
structType
))
{
ret
=
false
;
ret
=
false
;
}
}
...
@@ -614,8 +616,34 @@ public abstract class SearchProcessor {
...
@@ -614,8 +616,34 @@ public abstract class SearchProcessor {
}
}
}
}
// ATLAS-2118: Reserved regex characters in attribute value can cause the graph query to fail when parsing the contains regex
private
String
getContainsRegex
(
String
attributeValue
)
{
private
String
getContainsRegex
(
String
attributeValue
)
{
return
".*"
+
attributeValue
+
".*"
;
StringBuilder
escapedAttrVal
=
new
StringBuilder
(
".*"
);
for
(
int
i
=
0
;
i
<
attributeValue
.
length
();
i
++)
{
final
char
c
=
attributeValue
.
charAt
(
i
);
switch
(
c
)
{
case
'+'
:
case
'|'
:
case
'('
:
case
'{'
:
case
'['
:
case
'*'
:
case
'?'
:
case
'$'
:
case
'/'
:
case
'^'
:
escapedAttrVal
.
append
(
'\\'
);
break
;
}
escapedAttrVal
.
append
(
c
);
}
escapedAttrVal
.
append
(
".*"
);
return
escapedAttrVal
.
toString
();
}
}
private
String
getSuffixRegex
(
String
attributeValue
)
{
private
String
getSuffixRegex
(
String
attributeValue
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment