ConsumerConfiger.java
2.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
package com.yoho.search.consumer.common;
import com.yoho.search.base.beans.SearchPropertyPlaceholderConfigurer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
@Component
public class ConsumerConfiger {
@Autowired
private SearchPropertyPlaceholderConfigurer configurer;
/******************************for full build**************************************/
public int getSearchIndexBatchLimit(){
return configurer.getInt("search.index.batch.limit", 5000);
}
public int getSearchIndexBatchMaxThreadSize(){
return configurer.getInt("search.index.batch.max.thread.size", 5);
}
/******************************for tbl**************************************/
public String getTblProductUrl(){
return configurer.getString("tbl.product.url", "http://test.soa.global.yohobuy.com/product/api/v1/detail/");
}
public String getTblPrimaryKey(){
return configurer.getString("tbl.product.private.key", "a85bb0674e08986c6b115d5e3a4884fa");
}
public String getTblAdaptorDomain(){
return configurer.getString("tpl.adaptor.domain", "http://192.168.102.224:8085/search-adaptor");
}
/******************************for Suggestion**************************************/
public int getSuggestionCountBatchLimit (){
return configurer.getInt("suggestion.count.batch.limit", 300);
}
public int getSuggestionCountBatchMaxThreadSize(){
return configurer.getInt("suggestion.count.batch.max.thread.size", 1);
}
public int getSuggestionDiscoverBatchLimit(){
return configurer.getInt("suggestion.discover.batch.limit", 500);
}
public int getSuggestionDiscoverBatchMaxThreadSize(){
return configurer.getInt("suggestion.discover.batch.max.thread.size", 3);
}
/******************************for search**************************************/
public List<String> getSearchDefaultField(){
return configurer.getList("search.default.field");
}
public String getSearchMultiMatchQueryType(){
return configurer.getString("search.multiMatchQuery.type", "BEST_FIELDS");
}
public String getSearchOperator(){
return configurer.getString("search.operator", "or");
}
public String getSearchMinimumShouldMatch(){
return configurer.getString("search.minimum.should.match", "75%");
}
}