Browse Source

Pull request #3033: REPORT-44390 alpha-fine搜索帮助文档,右侧不展示详细内容,只显示文档名称

Merge in DESIGN/design from ~YVAN/design:release/10.0 to release/10.0

* commit '63779ffdcf6c8470218c2718f7345341eb672c09':
  REPORT-44390 alpha-fine搜索帮助文档,右侧不展示详细内容,只显示文档名称 改动:修改一下方法名
  REPORT-44390 alpha-fine搜索帮助文档,右侧不展示详细内容,只显示文档名称 【问题原因】本地常用的逻辑有点问题,比如用户搜索"定时填报",关键词被解析成关键词组,遍历关键词组去搜索结果,但是搜索结果的逻辑里会将结果集先清空然后添加新的,然后把这个返回的结果又赋值给结果集合,这会不断刷新结果集合,导致返回结果只是关键词组中最后一个元素的搜索结果 【改动思路】在搜索结果的逻辑里,将清空结果集的逻辑去掉,放到更上层的遍历之前,这样就不是每一次遍历就清空结果集,而是用户每一次搜索才清空结果集,然后搜索结果的返回值也无须赋值给结果集,因为在搜索的时候已经添加到结果集中了
feature/big-screen
Yvan 4 years ago
parent
commit
24dd17603d
  1. 14
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java

14
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java

@ -66,10 +66,10 @@ public class RecentSearchManager implements AlphaFineSearchProvider {
@Override @Override
public SearchResult getLessSearchResult(String[] searchText) { public SearchResult getLessSearchResult(String[] searchText) {
this.recentModelList = new SearchResult();
SearchResult modelList = new SearchResult(); SearchResult modelList = new SearchResult();
for (String aSearchText : searchText) { for (String aSearchText : searchText) {
recentModelList = getRecentModelList(aSearchText); addToRecentModelList(aSearchText);
} }
if (recentModelList != null && recentModelList.size() > 0) { if (recentModelList != null && recentModelList.size() > 0) {
modelList.add(new MoreModel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Latest"))); modelList.add(new MoreModel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Latest")));
@ -87,8 +87,12 @@ public class RecentSearchManager implements AlphaFineSearchProvider {
return new SearchResult(); return new SearchResult();
} }
private synchronized SearchResult getRecentModelList(String searchText) { /**
return searchBySort(searchText); * 将单次遍历的关键词的搜索结果添加到结果集中
* @param searchText
*/
private synchronized void addToRecentModelList(String searchText) {
searchBySort(searchText);
} }
public List<AlphaCellModel> getRecentModelList() { public List<AlphaCellModel> getRecentModelList() {
@ -161,7 +165,6 @@ public class RecentSearchManager implements AlphaFineSearchProvider {
* 按序搜索 * 按序搜索
*/ */
private synchronized SearchResult searchBySort(String key) { private synchronized SearchResult searchBySort(String key) {
recentModelList = new SearchResult();
try { try {
initReader(); initReader();
@ -175,7 +178,6 @@ public class RecentSearchManager implements AlphaFineSearchProvider {
Query query = new TermQuery(term); Query query = new TermQuery(term);
TopFieldDocs docs = searcher.search(query, MAX_SIZE, sortKey); TopFieldDocs docs = searcher.search(query, MAX_SIZE, sortKey);
ScoreDoc[] scores = docs.scoreDocs; ScoreDoc[] scores = docs.scoreDocs;
this.recentModelList = new SearchResult();
//遍历结果 //遍历结果
for (ScoreDoc scoreDoc : scores) { for (ScoreDoc scoreDoc : scores) {
Document document = searcher.doc(scoreDoc.doc); Document document = searcher.doc(scoreDoc.doc);

Loading…
Cancel
Save