MCPcopy Index your code
hub / github.com/TruthHun/BookStack / NewElasticSearchClient

Function NewElasticSearchClient

models/elasticsearch.go:106–116  ·  view source on GitHub ↗

创建全文搜索客户端

()

Source from the content-addressed store, hash-verified

104
105//创建全文搜索客户端
106func NewElasticSearchClient() (client *ElasticSearchClient) {
107 client = &ElasticSearchClient{
108 Host: GetOptionValue("ELASTICSEARCH_HOST", "http://localhost:9200/"),
109 Index: "bookstack",
110 Type: "fulltext",
111 On: GetOptionValue("ELASTICSEARCH_ON", "false") == "true",
112 Timeout: 10 * time.Second,
113 }
114 client.Host = strings.TrimRight(client.Host, "/") + "/"
115 return
116}
117
118// 将HTML转成符合elasticsearch搜索的文本
119func (this *ElasticSearchClient) html2Text(htmlStr string) string {

Callers 15

ReadMethod · 0.92
DeleteMethod · 0.92
SearchMethod · 0.92
SaveBookMethod · 0.92
PrivatelyOwnedMethod · 0.92
DeleteMethod · 0.92
EditBookMethod · 0.92
DeleteBookMethod · 0.92
SettingMethod · 0.92
PrivatelyOwnedMethod · 0.92
RebuildAllIndexMethod · 0.92
ResultMethod · 0.92

Calls 1

GetOptionValueFunction · 0.85

Tested by

no test coverage detected