mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-27 01:48:24 +00:00
fix advanced search issues
This commit is contained in:
parent
868762e513
commit
9ff38fa252
@ -424,6 +424,11 @@ public class AdvSearchDAO extends AbstractMySQLOpenSourceDAO
|
||||
{
|
||||
fieldAllIDs = fieldAllIDs.substring(0, fieldAllIDs.length()-1);
|
||||
}
|
||||
if (StringUtils.isBlank(fieldAllIDs))
|
||||
{
|
||||
fieldAllIDs = Integer.toString(0);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
List<Dataset> pagedDatasets = new ArrayList<Dataset>();
|
||||
@ -747,7 +752,6 @@ public class AdvSearchDAO extends AbstractMySQLOpenSourceDAO
|
||||
"WHEN urn LIKE 'hdfs://data/databases/%' THEN 4 " +
|
||||
"WHEN urn LIKE 'hdfs://data/dervied/%' THEN 5 ELSE 99 end, urn";
|
||||
}
|
||||
|
||||
if (StringUtils.isBlank(comments))
|
||||
{
|
||||
query += " LIMIT " + (page-1)*size + ", " + size;
|
||||
@ -803,13 +807,13 @@ public class AdvSearchDAO extends AbstractMySQLOpenSourceDAO
|
||||
public String doInTransaction(TransactionStatus status)
|
||||
{
|
||||
List<Map<String, Object>> rows = null;
|
||||
rows = jdbcTemplate.queryForList(queryString, (page-1)*size, size);
|
||||
rows = jdbcTemplate.queryForList(queryString);
|
||||
String idsString = "";
|
||||
|
||||
for (Map row : rows) {
|
||||
|
||||
int id = (int)row.get("id");
|
||||
idsString += id + ",";
|
||||
Long id = (Long)row.get("id");
|
||||
idsString += Long.toString(id) + ",";
|
||||
}
|
||||
if (StringUtils.isNotBlank(idsString))
|
||||
{
|
||||
|
||||
@ -28,6 +28,7 @@ App.AdvsearchRoute = Ember.Route.extend({
|
||||
for(var index = 0; index < data.result.data.length; index++) {
|
||||
var schema = data.result.data[index].schema;
|
||||
if (schema) {
|
||||
data.result.data[index].originalSchema = schema;
|
||||
highlightResultsforAdvSearch(data.result.data, index);
|
||||
}
|
||||
}
|
||||
|
||||
@ -68,7 +68,7 @@ App.SearchRoute = Ember.Route.extend({
|
||||
for(var index = 0; index < result.data.length; index++) {
|
||||
var schema = result.data[index].schema;
|
||||
if (schema) {
|
||||
result.data[index].originalSchema = result.data[index].schema;
|
||||
result.data[index].originalSchema = schema;
|
||||
highlightResults(result.data, index, keyword);
|
||||
}
|
||||
}
|
||||
|
||||
@ -371,7 +371,7 @@
|
||||
advSearchOpts.fields = {'any': fieldAny, 'all': fieldAll, 'not': fieldNotIn};
|
||||
advSearchOpts.comments = comments;
|
||||
advSearchOpts.sources = sources;
|
||||
window.location.hash = "#/advsearch/?query=" + btoa(JSON.stringify(advSearchOpts)) + '&page=1';
|
||||
window.location = "/#/advsearch/?query=" + btoa(JSON.stringify(advSearchOpts)) + '&page=1';
|
||||
}
|
||||
|
||||
function advSearchForFlow()
|
||||
@ -448,7 +448,7 @@
|
||||
advSearchOpts.appcode = {'in': appcodeIn, 'not': appcodeNotIn};
|
||||
advSearchOpts.flow = {'in': flowIn, 'not': flowNotIn};
|
||||
advSearchOpts.job = {'in': jobIn, 'not': jobNotIn};
|
||||
window.location.hash = "#/advsearch/?query=" + btoa(JSON.stringify(advSearchOpts)) + '&page=1';
|
||||
window.location = "/#/advsearch/?query=" + btoa(JSON.stringify(advSearchOpts)) + '&page=1';
|
||||
}
|
||||
|
||||
$('#advSearchBtn').click(function(){
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user