| @@ -52,7 +52,7 @@ DELETE FROM public.dataset_es; | |||
| b.user_id, | |||
| b.repo_id, | |||
| b.created_unix, | |||
| b.updated_unix,(select array_to_string(array_agg(name order by created_unix desc),',') from public.attachment a where a.dataset_id=b.id) | |||
| b.updated_unix,(select array_to_string(array_agg(name order by created_unix desc),'-#,#-') from public.attachment a where a.dataset_id=b.id and a.is_private=false) | |||
| FROM public.dataset b,public.repository c where b.repo_id=c.id and c.is_private=false; | |||
| CREATE OR REPLACE FUNCTION public.insert_dataset_data() RETURNS trigger AS | |||
| @@ -108,7 +108,7 @@ ALTER TABLE public.dataset ENABLE ALWAYS TRIGGER es_insert_dataset; | |||
| CREATE OR REPLACE FUNCTION public.udpate_dataset_file_name_delete() RETURNS trigger AS | |||
| $def$ | |||
| BEGIN | |||
| update public.dataset_es SET file_name=(select array_to_string(array_agg(name order by created_unix desc),',') from public.attachment where dataset_id=OLD.dataset_id) where id=OLD.dataset_id; | |||
| update public.dataset_es SET file_name=(select array_to_string(array_agg(name order by created_unix desc),'-#,#-') from public.attachment where dataset_id=OLD.dataset_id and is_private=false) where id=OLD.dataset_id; | |||
| return NEW; | |||
| END; | |||
| $def$ | |||
| @@ -129,8 +129,7 @@ $def$ | |||
| title=NEW.title, | |||
| category=NEW.category, | |||
| download_times=NEW.download_times, | |||
| file_name=(select array_to_string(array_agg(name order by created_unix desc),',') from public.attachment where dataset_id=NEW.id), | |||
| file_name=(select array_to_string(array_agg(name order by created_unix desc),'-#,#-') from public.attachment where dataset_id=NEW.id and is_private=false) | |||
| where id=NEW.id; | |||
| return new; | |||
| END | |||
| @@ -378,7 +378,7 @@ $def$ | |||
| b.user_id, | |||
| b.repo_id, | |||
| b.created_unix, | |||
| b.updated_unix,(select array_to_string(array_agg(name order by created_unix desc),',') from public.attachment a where a.dataset_id=b.id) | |||
| b.updated_unix,(select array_to_string(array_agg(name order by created_unix desc),',') from public.attachment a where a.dataset_id=b.id and a.is_private=false) | |||
| FROM public.dataset b where b.repo_id=NEW.id; | |||
| INSERT INTO public.issue_es( | |||
| @@ -82,7 +82,7 @@ var sortAscending={ | |||
| var currentPage = 1; | |||
| var pageSize = 15; | |||
| var currentSearchTableName =""; | |||
| var currentSearchTableName ="repository"; | |||
| var currentSearchKeyword=""; | |||
| var currentSearchSortBy=""; | |||
| var currentSearchAscending=false; | |||
| @@ -120,16 +120,28 @@ function search(){ | |||
| currentSearchKeyword = document.getElementById("keyword_input").value; | |||
| initPageInfo(); | |||
| if(!isEmpty(currentSearchKeyword)){ | |||
| currentSearchTableName = "repository"; | |||
| currentSearchSortBy = sortBy[10]; | |||
| currentSearchAscending = false; | |||
| OnlySearchLabel =false; | |||
| page(currentPage); | |||
| doSearch("issue",currentSearchKeyword,1,pageSize,true,"",false); | |||
| doSearch("user",currentSearchKeyword,1,pageSize,true,"",false); | |||
| doSearch("org",currentSearchKeyword,1,pageSize,true,"",false); | |||
| doSearch("dataset",currentSearchKeyword,1,pageSize,true,"",false); | |||
| doSearch("pr",currentSearchKeyword,1,pageSize,true,"",false); | |||
| if(currentSearchTableName != "repository"){ | |||
| doSearch("repository",currentSearchKeyword,1,pageSize,true,"",false); | |||
| } | |||
| if(currentSearchTableName != "issue"){ | |||
| doSearch("issue",currentSearchKeyword,1,pageSize,true,"",false); | |||
| } | |||
| if(currentSearchTableName != "user"){ | |||
| doSearch("user",currentSearchKeyword,1,pageSize,true,"",false); | |||
| } | |||
| if(currentSearchTableName != "org"){ | |||
| doSearch("org",currentSearchKeyword,1,pageSize,true,"",false); | |||
| } | |||
| if(currentSearchTableName != "dataset"){ | |||
| doSearch("dataset",currentSearchKeyword,1,pageSize,true,"",false); | |||
| } | |||
| if(currentSearchTableName != "dataset"){ | |||
| doSearch("dataset",currentSearchKeyword,1,pageSize,true,"",false); | |||
| } | |||
| } | |||
| } | |||
| @@ -648,7 +660,7 @@ var repoAndOrgEN={ | |||
| function page(current){ | |||
| //function doSearch(tableName,keyword,page,pageSize=15,onlyReturnNum=true,sortBy="",OnlySearchLabel=false){ | |||
| currentPage=current; | |||
| doSearch(currentSearchTableName,currentSearchKeyword,current,pageSize,false,currentSearchSortBy,OnlySearchLabel); | |||