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
dd030eca
Commit
dd030eca
authored
8 years ago
by
Suma Shivaprasad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-1088 Fix /search api to default to fulltext on dsl failure (sumasai)
parent
a165234c
master
No related merge requests found
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
1 deletion
+33
-1
release-log.txt
release-log.txt
+1
-0
MetadataDiscoveryResource.java
...apache/atlas/web/resources/MetadataDiscoveryResource.java
+13
-1
MetadataDiscoveryJerseyResourceIT.java
...tlas/web/resources/MetadataDiscoveryJerseyResourceIT.java
+19
-0
No files found.
release-log.txt
View file @
dd030eca
...
@@ -6,6 +6,7 @@ INCOMPATIBLE CHANGES:
...
@@ -6,6 +6,7 @@ INCOMPATIBLE CHANGES:
ALL CHANGES:
ALL CHANGES:
ATLAS-1088 Fix /search api to default to fulltext on dsl failure (sumasai)
ATLAS-762 Assertion in NegativeSSLAndKerberosTest.testUnsecuredClient needs to be hardened (nixonrodrigues via sumasai)
ATLAS-762 Assertion in NegativeSSLAndKerberosTest.testUnsecuredClient needs to be hardened (nixonrodrigues via sumasai)
ATLAS-1071 Regression - UI - Details Button under Audits Tab is not working.(kevalbhatt18 via sumasai)
ATLAS-1071 Regression - UI - Details Button under Audits Tab is not working.(kevalbhatt18 via sumasai)
ATLAS-965 Old lineage still exists after dropping tables and re-creating tables with same name. (shwethags via sumasai)
ATLAS-965 Old lineage still exists after dropping tables and re-creating tables with same name. (shwethags via sumasai)
...
...
This diff is collapsed.
Click to expand it.
webapp/src/main/java/org/apache/atlas/web/resources/MetadataDiscoveryResource.java
View file @
dd030eca
...
@@ -93,8 +93,20 @@ public class MetadataDiscoveryResource {
...
@@ -93,8 +93,20 @@ public class MetadataDiscoveryResource {
if
(
AtlasPerfTracer
.
isPerfTraceEnabled
(
PERF_LOG
))
{
if
(
AtlasPerfTracer
.
isPerfTraceEnabled
(
PERF_LOG
))
{
perf
=
AtlasPerfTracer
.
getPerfTracer
(
PERF_LOG
,
"MetadataDiscoveryResource.search("
+
query
+
", "
+
limit
+
", "
+
offset
+
")"
);
perf
=
AtlasPerfTracer
.
getPerfTracer
(
PERF_LOG
,
"MetadataDiscoveryResource.search("
+
query
+
", "
+
limit
+
", "
+
offset
+
")"
);
}
}
Response
response
=
searchUsingQueryDSL
(
query
,
limit
,
offset
);
boolean
dslQueryFailed
=
false
;
Response
response
=
null
;
try
{
response
=
searchUsingQueryDSL
(
query
,
limit
,
offset
);
if
(
response
.
getStatus
()
!=
Response
.
Status
.
OK
.
getStatusCode
())
{
if
(
response
.
getStatus
()
!=
Response
.
Status
.
OK
.
getStatusCode
())
{
dslQueryFailed
=
true
;
}
}
catch
(
Exception
e
)
{
LOG
.
debug
(
"Error while running DSL. Switching to fulltext for query {}"
,
query
,
e
);
dslQueryFailed
=
true
;
}
if
(
dslQueryFailed
)
{
response
=
searchUsingFullText
(
query
,
limit
,
offset
);
response
=
searchUsingFullText
(
query
,
limit
,
offset
);
}
}
AtlasPerfTracer
.
log
(
perf
);
AtlasPerfTracer
.
log
(
perf
);
...
...
This diff is collapsed.
Click to expand it.
webapp/src/test/java/org/apache/atlas/web/resources/MetadataDiscoveryJerseyResourceIT.java
View file @
dd030eca
...
@@ -196,6 +196,25 @@ public class MetadataDiscoveryJerseyResourceIT extends BaseResourceIT {
...
@@ -196,6 +196,25 @@ public class MetadataDiscoveryJerseyResourceIT extends BaseResourceIT {
assertEquals
(
response
.
getString
(
"queryType"
),
"dsl"
);
assertEquals
(
response
.
getString
(
"queryType"
),
"dsl"
);
}
}
@Test
public
void
testSearchFullTextOnDSLFailure
()
throws
Exception
{
String
query
=
"*"
;
WebResource
resource
=
service
.
path
(
"api/atlas/discovery/search"
).
queryParam
(
"query"
,
query
);
ClientResponse
clientResponse
=
resource
.
accept
(
Servlets
.
JSON_MEDIA_TYPE
).
type
(
Servlets
.
JSON_MEDIA_TYPE
)
.
method
(
HttpMethod
.
GET
,
ClientResponse
.
class
);
assertEquals
(
clientResponse
.
getStatus
(),
Response
.
Status
.
OK
.
getStatusCode
());
String
responseAsString
=
clientResponse
.
getEntity
(
String
.
class
);
Assert
.
assertNotNull
(
responseAsString
);
JSONObject
response
=
new
JSONObject
(
responseAsString
);
Assert
.
assertNotNull
(
response
.
get
(
AtlasClient
.
REQUEST_ID
));
assertEquals
(
response
.
getString
(
"query"
),
query
);
assertEquals
(
response
.
getString
(
"queryType"
),
"full-text"
);
}
@Test
(
dependsOnMethods
=
"testSearchDSLLimits"
)
@Test
(
dependsOnMethods
=
"testSearchDSLLimits"
)
public
void
testSearchUsingFullText
()
throws
Exception
{
public
void
testSearchUsingFullText
()
throws
Exception
{
JSONObject
response
=
serviceClient
.
searchByFullText
(
tagName
,
10
,
0
);
JSONObject
response
=
serviceClient
.
searchByFullText
(
tagName
,
10
,
0
);
...
...
This diff is collapsed.
Click to expand it.
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