去除所有的System.out.println
Showing
7 changed files
with
0 additions
and
98 deletions
@@ -38,7 +38,6 @@ public abstract class AbstractCacheRequestResponse<Request extends ICacheRequest | @@ -38,7 +38,6 @@ public abstract class AbstractCacheRequestResponse<Request extends ICacheRequest | ||
38 | return v->{ | 38 | return v->{ |
39 | Type superClass = getClass().getGenericSuperclass(); | 39 | Type superClass = getClass().getGenericSuperclass(); |
40 | Type type = ((ParameterizedType) superClass).getActualTypeArguments()[1]; | 40 | Type type = ((ParameterizedType) superClass).getActualTypeArguments()[1]; |
41 | - System.out.println(type.getTypeName()); | ||
42 | return JSON.parseObject(v,type); | 41 | return JSON.parseObject(v,type); |
43 | }; | 42 | }; |
44 | } | 43 | } |
@@ -62,13 +62,4 @@ public class SearchKeyWordUtils { | @@ -62,13 +62,4 @@ public class SearchKeyWordUtils { | ||
62 | return keyword; | 62 | return keyword; |
63 | } | 63 | } |
64 | 64 | ||
65 | - | ||
66 | - public static void main(String[] args) throws Exception { | ||
67 | - String a = "adidas Originals"; | ||
68 | - String aencode = URLEncoder.encode(a, StandardCharsets.UTF_8.name()); | ||
69 | - System.out.println(aencode); | ||
70 | - String adecode = URLDecoder.decode(aencode, StandardCharsets.UTF_8.name()); | ||
71 | - System.out.println(adecode); | ||
72 | - } | ||
73 | - | ||
74 | } | 65 | } |
1 | -package com.yoho.search.restapi.tools; | ||
2 | - | ||
3 | -import com.yoho.search.base.utils.ProductIndexEsField; | ||
4 | -import com.yoho.search.core.es.model.SearchField; | ||
5 | -import com.yoho.search.core.es.model.SearchParam; | ||
6 | -import com.yoho.search.core.es.utils.SearchParamUtils; | ||
7 | -import org.elasticsearch.index.query.MultiMatchQueryBuilder; | ||
8 | -import org.elasticsearch.index.query.QueryBuilders; | ||
9 | -import org.elasticsearch.search.sort.SortBuilders; | ||
10 | -import org.elasticsearch.search.sort.SortOrder; | ||
11 | - | ||
12 | -import java.util.Arrays; | ||
13 | - | ||
14 | -public class SearchParamsTest { | ||
15 | - | ||
16 | - public static void main(String[] args) { | ||
17 | - SearchParam searchParam = new SearchParam(); | ||
18 | - | ||
19 | - MultiMatchQueryBuilder multiMatchQueryBuilder = QueryBuilders.multiMatchQuery("刺绣卫衣"); | ||
20 | - multiMatchQueryBuilder.field(ProductIndexEsField.smallSort, 1000); | ||
21 | - multiMatchQueryBuilder.field(ProductIndexEsField.productName_productName_ansj, 300); | ||
22 | - multiMatchQueryBuilder.minimumShouldMatch("100%"); | ||
23 | - searchParam.setQuery(multiMatchQueryBuilder); | ||
24 | - | ||
25 | - searchParam.setSize(100); | ||
26 | - searchParam.setSortBuilders(Arrays.asList(SortBuilders.scoreSort().order(SortOrder.DESC))); | ||
27 | - System.out.println(SearchParamUtils.genSearchSourceBuilderFromSearchParam(searchParam)); | ||
28 | - } | ||
29 | - | ||
30 | -} |
@@ -82,13 +82,4 @@ public class PriceAggregation extends AbstractAggregation { | @@ -82,13 +82,4 @@ public class PriceAggregation extends AbstractAggregation { | ||
82 | } | 82 | } |
83 | return map; | 83 | return map; |
84 | } | 84 | } |
85 | - | ||
86 | - public static void main(String[] args) { | ||
87 | - float[] allPrices = {10.5f, 20.5f, 30.5f, 49.5f, 55.5f, 66.6f, 77.7f, 88.7f, 99.9f, 111.1f, 122.2f, 133.3f, 555.5f, 666.6f, 777.7f, 778f, 779, 779.11f}; | ||
88 | - float maxPrice = allPrices[allPrices.length - 1]; | ||
89 | - List<Integer> intervals = PriceRangeUtils.getPriceInterval(allPrices, maxPrice); | ||
90 | - System.out.println(intervals); | ||
91 | - // 将的到的价格数组组装成前端显示的价格列表 | ||
92 | - System.out.println(getPriceResult(intervals, maxPrice)); | ||
93 | - } | ||
94 | } | 85 | } |
@@ -61,35 +61,4 @@ public class ProductListSortHelper { | @@ -61,35 +61,4 @@ public class ProductListSortHelper { | ||
61 | return tempResults; | 61 | return tempResults; |
62 | } | 62 | } |
63 | 63 | ||
64 | - public static void main(String[] args) { | ||
65 | - List<Integer> list = new ArrayList<>(); | ||
66 | - for(int i =1 ;i<=10;i++){ | ||
67 | - list.add(i); | ||
68 | - list.add(i); | ||
69 | - list.add(i); | ||
70 | - list.add(i); | ||
71 | - } | ||
72 | - list.add(10000); | ||
73 | - list.add(100001); | ||
74 | - System.out.println(list.size()); | ||
75 | - List<Integer> newList = new ProductListSortHelper().sortProductList(list, new ProductListSortKey<Integer>() { | ||
76 | - @Override | ||
77 | - public String getSortKey(Integer product) { | ||
78 | - return product.toString(); | ||
79 | - } | ||
80 | - | ||
81 | - @Override | ||
82 | - public int getMaxCount() { | ||
83 | - return 2; | ||
84 | - } | ||
85 | - | ||
86 | - @Override | ||
87 | - public int getMaxLength() { | ||
88 | - return 8; | ||
89 | - } | ||
90 | - }); | ||
91 | - System.out.println(newList); | ||
92 | - System.out.println(newList.size()); | ||
93 | - } | ||
94 | - | ||
95 | } | 64 | } |
@@ -50,12 +50,4 @@ public class W2vFeatureCalculator { | @@ -50,12 +50,4 @@ public class W2vFeatureCalculator { | ||
50 | } | 50 | } |
51 | } | 51 | } |
52 | 52 | ||
53 | - public static void main(String[] args) { | ||
54 | - List<Double> array = ConvertUtils.stringToDoubleList("0.342045,-0.547933,0.291732,-0.056515,-0.182701,0.31113,0.151578,0.087678,-0.045536,-0.525699,-0.394715,-0.103153,-0.05575,-0.540641,0.028046,-0.193109,-0.003591,0.180923,0.290261,0.532309,-0.202463,-0.047271,-0.246197,0.324561,0.188814,0.36475,0.079007,0.455753,-0.11848,-0.135874,-0.187155,-0.055342,-0.12525,0.210669,-0.388331,-0.197123,0.132309,-0.4231,0.217752,-0.203266,0.190836,0.373428,-0.0102,-0.038654,0.2379,0.044424,0.071826,-0.201054,0.257434,0.141901,-0.390064,0.437099,0.559701,-0.040162,-0.193089,0.442338,-0.141678,-0.049696,0.315545,-0.028972,0.278694,-0.064345,-0.327943,0.103025,-0.40344,-0.34269,-0.237931,0.287046,0.139693,-0.38454,0.019959,-0.156907,0.374996,-0.074558,-0.019391,0.050522,0.315171,0.211605,-0.15418,0.502362,0.10184,0.153274,0.592659,-0.010284,0.28029,0.319741,-0.164559,0.286884,0.420483,-0.628866,-0.172259,0.027954,-0.411674,0.376585,0.322832,0.352039,0.078705,0.045152,0.139083,-0.164182", ","); | ||
55 | - PersonalizedSearch personalizedSearch = new PersonalizedSearch("1", "20180408", array); | ||
56 | - UserFeatureFactor userFeatureFactor = new UserFeatureFactor(personalizedSearch); | ||
57 | - String productFeatureFactor = "20180408|1.342045,-0.547933,0.291732,-0.056515,-0.182701,0.31113,0.151578,0.087678,-0.045536,-0.525699,-0.394715,-0.103153,-0.05575,-0.540641,0.028046,-0.193109,-0.003591,0.180923,0.290261,0.532309,-0.202463,-0.047271,-0.246197,0.324561,0.188814,0.36475,0.079007,0.455753,-0.11848,-0.135874,-0.187155,-0.055342,-0.12525,0.210669,-0.388331,-0.197123,0.132309,-0.4231,0.217752,-0.203266,0.190836,0.373428,-0.0102,-0.038654,0.2379,0.044424,0.071826,-0.201054,0.257434,0.141901,-0.390064,0.437099,0.559701,-0.040162,-0.193089,0.442338,-0.141678,-0.049696,0.315545,-0.028972,0.278694,-0.064345,-0.327943,0.103025,-0.40344,-0.34269,-0.237931,0.287046,0.139693,-0.38454,0.019959,-0.156907,0.374996,-0.074558,-0.019391,0.050522,0.315171,0.211605,-0.15418,0.502362,0.10184,0.153274,0.592659,-0.010284,0.28029,0.319741,-0.164559,0.286884,0.420483,-0.628866,-0.172259,0.027954,-0.411674,0.376585,0.322832,0.352039,0.078705,0.045152,0.139083,-0.164182"; | ||
58 | - System.out.println(calProductFeatureFactor(userFeatureFactor, productFeatureFactor)); | ||
59 | - } | ||
60 | - | ||
61 | } | 53 | } |
service/src/main/java/com/yoho/search/service/scene/recommend/RecommendOnProductAnalysisService.java
@@ -465,14 +465,4 @@ public class RecommendOnProductAnalysisService { | @@ -465,14 +465,4 @@ public class RecommendOnProductAnalysisService { | ||
465 | } | 465 | } |
466 | return new UserPersonalFactorRsp(); | 466 | return new UserPersonalFactorRsp(); |
467 | } | 467 | } |
468 | - | ||
469 | - public static void main(String[] args) { | ||
470 | - List<Integer> personalSortIds = new ArrayList<>(); | ||
471 | - for (int i = 0; i < 10; i++) { | ||
472 | - personalSortIds.add(i); | ||
473 | - } | ||
474 | - System.out.println(personalSortIds.stream().distinct().collect(Collectors.toList())); | ||
475 | - System.out.println(); | ||
476 | - } | ||
477 | - | ||
478 | } | 468 | } |
-
Please register or login to post a comment