SearchServiceConfiger.java
1.16 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
package com.yoho.search.common;
import com.yoho.search.base.beans.SearchPropertyPlaceholderConfigurer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class SearchServiceConfiger {
@Autowired
private SearchPropertyPlaceholderConfigurer configurer;
public String getSearchEsClusterName(){
return configurer.getString("search.es.cluster.name","");
}
public String getSearchEsServers(){
return configurer.getString("search.es.servers","");
}
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%");
}
public String getUfoSearchMinimumShouldMatch(){
return configurer.getString("ufo.search.minimum.should.match", "2<70%");
}
public boolean useCache() {
return configurer.getBoolean("search.use.cache", true);
}
}