Skip to content

Commit 94696fc

Browse files
committed
Merge pull request #36 from Flowpack/indexsettings
[FEATURE] Allow to set Index Settings for the Nodes-Index
2 parents 9dae6d5 + fd33d18 commit 94696fc

2 files changed

Lines changed: 33 additions & 1 deletion

File tree

Classes/Flowpack/ElasticSearch/ContentRepositoryAdaptor/Indexer/NodeIndexer.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ public function setIndexNamePostfix($indexNamePostfix) {
124124
* @return Index
125125
*/
126126
public function getIndex() {
127-
return $this->searchClient->findIndex($this->getIndexName());
127+
$index = $this->searchClient->findIndex($this->getIndexName());
128+
$index->setSettingsKey($this->searchClient->getIndexName());
129+
return $index;
128130
}
129131

130132
/**

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,36 @@ changes the index alias.
114114
```
115115

116116

117+
### Advanced Index Settings
118+
If you need advanced settings you can define them in your *Settings.yaml*:
119+
120+
Example is from the Documentation of the used *Flowpack.ElasticSearch* Package
121+
122+
https://github.com/Flowpack/Flowpack.ElasticSearch/blob/master/Documentation/Indexer.rst
123+
124+
```
125+
Flowpack:
126+
ElasticSearch:
127+
indexes:
128+
default:
129+
'twitter':
130+
analysis:
131+
filter:
132+
elision:
133+
type: 'elision'
134+
articles: [ 'l', 'm', 't', 'qu', 'n', 's', 'j', 'd' ]
135+
analyzer:
136+
custom_french_analyzer:
137+
tokenizer: 'letter'
138+
filter: [ 'asciifolding', 'lowercase', 'french_stem', 'elision', 'stop' ]
139+
tag_analyzer:
140+
tokenizer: 'keyword'
141+
filter: [ 'asciifolding', 'lowercase' ]
142+
```
143+
144+
If you use multiple client configurations, please change the *default* key just below the *indexes*.
145+
146+
117147
## Doing Arbitrary Queries
118148

119149
We'll first show how to do arbitrary ElasticSearch Queries in TypoScript. This is a more powerful

0 commit comments

Comments
 (0)