From c8f11c229b87d1652b6da0b15576c166cd51eb8b Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期三, 01 一月 2020 14:25:22 +0800
Subject: [PATCH] 首页悬浮图mapperbug修改,增加商品详情中的比例展示

---
 fanli/src/main/java/com/yeshi/fanli/dao/elastic/ESOrderDao.java |   52 +---------------------------------------------------
 1 files changed, 1 insertions(+), 51 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/dao/elastic/ESOrderDao.java b/fanli/src/main/java/com/yeshi/fanli/dao/elastic/ESOrderDao.java
index 92723fc..9d6868f 100644
--- a/fanli/src/main/java/com/yeshi/fanli/dao/elastic/ESOrderDao.java
+++ b/fanli/src/main/java/com/yeshi/fanli/dao/elastic/ESOrderDao.java
@@ -4,22 +4,14 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.elasticsearch.action.search.MultiSearchRequest;
-import org.elasticsearch.action.search.MultiSearchResponse;
-import org.elasticsearch.action.search.MultiSearchResponse.Item;
 import org.elasticsearch.action.search.SearchRequest;
 import org.elasticsearch.action.search.SearchResponse;
 import org.elasticsearch.client.RequestOptions;
 import org.elasticsearch.common.unit.Fuzziness;
 import org.elasticsearch.index.query.BoolQueryBuilder;
-import org.elasticsearch.index.query.FuzzyQueryBuilder;
-import org.elasticsearch.index.query.MatchPhraseQueryBuilder;
 import org.elasticsearch.index.query.MatchQueryBuilder;
-import org.elasticsearch.index.query.MoreLikeThisQueryBuilder;
-import org.elasticsearch.index.query.MultiMatchQueryBuilder;
 import org.elasticsearch.index.query.QueryBuilders;
 import org.elasticsearch.index.query.TermQueryBuilder;
-import org.elasticsearch.index.query.WildcardQueryBuilder;
 import org.elasticsearch.search.SearchHit;
 import org.elasticsearch.search.SearchHits;
 import org.elasticsearch.search.builder.SearchSourceBuilder;
@@ -31,48 +23,6 @@
 
 @Repository
 public class ESOrderDao extends ElasticBaseDao<ESOrder> {
-
-	/**
-	 * 鏌ヨ鍖归厤
-	 * 
-	 * @param key 鎼滅储璇�
-	 * @param uid 鐢ㄦ埛id
-	 * @return
-	 */
-	public List<ESOrder> queryMatch(String key, String uid) {
-		List<ESOrder> list = new ArrayList<ESOrder>();
-
-		// 鍟嗗搧鍚嶇О鍖归厤
-		MatchQueryBuilder match1 = new MatchQueryBuilder("goodsName", key).fuzziness(Fuzziness.AUTO);
-		// 璁㈠崟鍙峰尮閰�
-		MatchQueryBuilder match2 = new MatchQueryBuilder("orderNo", key).fuzziness(Fuzziness.AUTO);
-
-		TermQueryBuilder term1 = QueryBuilders.termQuery("uid", uid);
-		// 涓婄骇
-		TermQueryBuilder term2 = QueryBuilders.termQuery("uidDirect", uid);
-		// 涓婁笂绾�
-		TermQueryBuilder term3 = QueryBuilders.termQuery("uidIndirect", uid);
-
-		SearchSourceBuilder sourceBuilder = new SearchSourceBuilder();
-		sourceBuilder.query(match1).query(match2).query(term1).query(term2).query(term3);
-
-		SearchRequest searchRequest = new SearchRequest();
-		searchRequest.indices(index);
-		searchRequest.source(sourceBuilder);
-		try {
-			SearchResponse searchResponse = client.search(searchRequest, RequestOptions.DEFAULT);
-			SearchHits hits = searchResponse.getHits();
-			SearchHit[] searchHits = hits.getHits();
-			Gson gson = new Gson();
-			for (SearchHit hit : searchHits) {
-				String content = hit.getSourceAsString();
-				list.add(gson.fromJson(content, ESOrder.class));
-			}
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-		return list;
-	}
 
 	/**
 	 * 鏌ヨ鍖归厤
@@ -95,7 +45,7 @@
 		sourceBuilder.query(QueryBuilders.boolQuery().must(should1).must(should2));
 		
 		SearchRequest searchRequest = new SearchRequest();
-		searchRequest.indices(index);
+		searchRequest.indices(getDocument(ESOrder.class));
 		searchRequest.source(sourceBuilder);
 		try {
 			SearchResponse searchResponse = client.search(searchRequest, RequestOptions.DEFAULT);

--
Gitblit v1.8.0