-
Notifications
You must be signed in to change notification settings - Fork 15
/
config.php
executable file
·91 lines (77 loc) · 2.83 KB
/
config.php
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?php
/**
* Elasticsearch plugin for Craft CMS 3.x
*
* Bring the power of Elasticsearch to you Craft 3 CMS project
*
* @link https://www.lahautesociete.com
* @copyright Copyright (c) 2018 La Haute Société
*/
/**
* Elasticsearch config.php
*
* This file exists only as a template for the Elasticsearch settings.
* It does nothing on its own.
*
* Don't edit this file, instead copy it to 'craft/config' as 'elasticsearch.php'
* and make your changes there to override default settings.
*
* Once copied to 'craft/config', this file will be multi-environment aware as
* well, so you can have different settings groups for each environment, just as
* you do for 'general.php'
*/
return [
'elasticsearchEndpoint' => 'https://long-hash.eu-central-1.aws.cloud.example.com:9243',
'isAuthEnabled' => true,
'username' => 'elastic',
'password' => 'password',
'indexNamePrefix' => '',
'highlight' => [
'pre_tags' => '<strong>',
'post_tags' => '</strong>',
],
'blacklistedEntryTypes' => [],
'blacklistedAssetVolumes' => [],
'contentExtractorCallback' => function (string $entryContent) {
if (preg_match('/<!-- BEGIN elasticsearch indexed content -->(.*)<!-- END elasticsearch indexed content -->/s', $entryContent, $body)) {
$entryContent = '<!DOCTYPE html>' . trim($body[1]);
}
return $entryContent;
},
// 'elementContentCallback' => function (\craft\base\ElementInterface $element) {
// return '<span>Some HTML element content to index</span>';
// },
// 'resultFormatterCallback' => function (array $formattedResult, $result) {
// // Do something
// },
// The `elasticsearchEndpoint`, `username`, `password` and `isAuthEnabled` settings are ignored if this is set
'elasticsearchComponentConfig' => [
'autodetectCluster' => false,
'defaultProtocol' => 'http',
'nodes' => [
[
'protocol' => 'https',
'http_address' => 'long-hash.eu-central-1.aws.cloud.example.com:9243',
],
],
'auth' => [
'username' => 'elastic',
'password' => 'password',
],
'connectionTimeout' => 10,
'dataTimeout' => 30,
],
// 'extraFields' => [
// 'fieldOne' => [
// 'mapping' => [
// 'type' => 'text',
// 'analyzer' => 'standard',
// 'store' => true
// ],
// 'highlighter' => (object)['type' => 'plain'],
// 'value' => function (\craft\base\ElementInterface $element, \lhs\elasticsearch\records\ElasticsearchRecord $esRecord) {
// // Return something
// }
// ]
// ]
];