Authored by 胡古飞

remove invalid code

@@ -25,7 +25,6 @@ public class SearchCommonService implements ApplicationEventPublisherAware { @@ -25,7 +25,6 @@ public class SearchCommonService implements ApplicationEventPublisherAware {
25 25
26 @Autowired 26 @Autowired
27 private ESClientMgr esClientMgr; 27 private ESClientMgr esClientMgr;
28 -  
29 @Autowired 28 @Autowired
30 private YohoIndexHelper yohoIndexHelper; 29 private YohoIndexHelper yohoIndexHelper;
31 30
@@ -59,9 +58,6 @@ public class SearchCommonService implements ApplicationEventPublisherAware { @@ -59,9 +58,6 @@ public class SearchCommonService implements ApplicationEventPublisherAware {
59 * @return 58 * @return
60 */ 59 */
61 public SearchResult doSearch(final String indexName, final SearchParam searchParam) { 60 public SearchResult doSearch(final String indexName, final SearchParam searchParam) {
62 - // TODO: need be tested  
63 - // SearchResult searchResult = yohoIndexService.search(indexName,  
64 - // searchParam);  
65 IElasticsearchClient client = esClientMgr.getClient(indexName); 61 IElasticsearchClient client = esClientMgr.getClient(indexName);
66 SearchResult searchResult = client.search(indexName, indexName, searchParam); 62 SearchResult searchResult = client.search(indexName, indexName, searchParam);
67 this.publishSearchResultEvent(indexName, searchParam, searchResult); 63 this.publishSearchResultEvent(indexName, searchParam, searchResult);
@@ -92,10 +88,6 @@ public class SearchCommonService implements ApplicationEventPublisherAware { @@ -92,10 +88,6 @@ public class SearchCommonService implements ApplicationEventPublisherAware {
92 if (searchParams == null || searchParams.isEmpty()) { 88 if (searchParams == null || searchParams.isEmpty()) {
93 return new ArrayList<SearchResult>(); 89 return new ArrayList<SearchResult>();
94 } 90 }
95 -  
96 - // TODO: need be tested  
97 - // List<SearchResult> results = yohoIndexService.multiSearch(indexName,  
98 - // searchParams);  
99 IElasticsearchClient client = esClientMgr.getClient(indexName); 91 IElasticsearchClient client = esClientMgr.getClient(indexName);
100 List<SearchResult> results = client.multiSearch(indexName, indexName, searchParams); 92 List<SearchResult> results = client.multiSearch(indexName, indexName, searchParams);
101 for (int i = 0; i < searchParams.size(); i++) { 93 for (int i = 0; i < searchParams.size(); i++) {
@@ -118,9 +110,6 @@ public class SearchCommonService implements ApplicationEventPublisherAware { @@ -118,9 +110,6 @@ public class SearchCommonService implements ApplicationEventPublisherAware {
118 if (StringUtils.isBlank(id)) { 110 if (StringUtils.isBlank(id)) {
119 return map; 111 return map;
120 } 112 }
121 -  
122 - // TODO: need be tested  
123 - // GetResponse response = yohoIndexService.get(indexName, id);  
124 IElasticsearchClient client = esClientMgr.getClient(indexName); 113 IElasticsearchClient client = esClientMgr.getClient(indexName);
125 String realIndexName = yohoIndexHelper.getRealIndexName(indexName, client); 114 String realIndexName = yohoIndexHelper.getRealIndexName(indexName, client);
126 if (StringUtils.isBlank(realIndexName)) { 115 if (StringUtils.isBlank(realIndexName)) {
@@ -185,10 +174,6 @@ public class SearchCommonService implements ApplicationEventPublisherAware { @@ -185,10 +174,6 @@ public class SearchCommonService implements ApplicationEventPublisherAware {
185 if (idSet == null || idSet.size() == 0) { 174 if (idSet == null || idSet.size() == 0) {
186 return result; 175 return result;
187 } 176 }
188 -  
189 - // TODO: need be tested  
190 - // MultiGetResponse response = yohoIndexService.multiGet(indexName,  
191 - // idSet, fields);  
192 IElasticsearchClient client = esClientMgr.getClient(indexName); 177 IElasticsearchClient client = esClientMgr.getClient(indexName);
193 String realIndexName = yohoIndexHelper.getRealIndexName(indexName, client); 178 String realIndexName = yohoIndexHelper.getRealIndexName(indexName, client);
194 if (StringUtils.isBlank(realIndexName)) { 179 if (StringUtils.isBlank(realIndexName)) {