...
|
...
|
@@ -25,7 +25,6 @@ public class SearchCommonService implements ApplicationEventPublisherAware { |
|
|
|
|
|
@Autowired
|
|
|
private ESClientMgr esClientMgr;
|
|
|
|
|
|
@Autowired
|
|
|
private YohoIndexHelper yohoIndexHelper;
|
|
|
|
...
|
...
|
@@ -59,9 +58,6 @@ public class SearchCommonService implements ApplicationEventPublisherAware { |
|
|
* @return
|
|
|
*/
|
|
|
public SearchResult doSearch(final String indexName, final SearchParam searchParam) {
|
|
|
// TODO: need be tested
|
|
|
// SearchResult searchResult = yohoIndexService.search(indexName,
|
|
|
// searchParam);
|
|
|
IElasticsearchClient client = esClientMgr.getClient(indexName);
|
|
|
SearchResult searchResult = client.search(indexName, indexName, searchParam);
|
|
|
this.publishSearchResultEvent(indexName, searchParam, searchResult);
|
...
|
...
|
@@ -92,10 +88,6 @@ public class SearchCommonService implements ApplicationEventPublisherAware { |
|
|
if (searchParams == null || searchParams.isEmpty()) {
|
|
|
return new ArrayList<SearchResult>();
|
|
|
}
|
|
|
|
|
|
// TODO: need be tested
|
|
|
// List<SearchResult> results = yohoIndexService.multiSearch(indexName,
|
|
|
// searchParams);
|
|
|
IElasticsearchClient client = esClientMgr.getClient(indexName);
|
|
|
List<SearchResult> results = client.multiSearch(indexName, indexName, searchParams);
|
|
|
for (int i = 0; i < searchParams.size(); i++) {
|
...
|
...
|
@@ -118,9 +110,6 @@ public class SearchCommonService implements ApplicationEventPublisherAware { |
|
|
if (StringUtils.isBlank(id)) {
|
|
|
return map;
|
|
|
}
|
|
|
|
|
|
// TODO: need be tested
|
|
|
// GetResponse response = yohoIndexService.get(indexName, id);
|
|
|
IElasticsearchClient client = esClientMgr.getClient(indexName);
|
|
|
String realIndexName = yohoIndexHelper.getRealIndexName(indexName, client);
|
|
|
if (StringUtils.isBlank(realIndexName)) {
|
...
|
...
|
@@ -185,10 +174,6 @@ public class SearchCommonService implements ApplicationEventPublisherAware { |
|
|
if (idSet == null || idSet.size() == 0) {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
// TODO: need be tested
|
|
|
// MultiGetResponse response = yohoIndexService.multiGet(indexName,
|
|
|
// idSet, fields);
|
|
|
IElasticsearchClient client = esClientMgr.getClient(indexName);
|
|
|
String realIndexName = yohoIndexHelper.getRealIndexName(indexName, client);
|
|
|
if (StringUtils.isBlank(realIndexName)) {
|
...
|
...
|
|