Skip to content

Commit f6449ec

Browse files
committed
TASK: Document new Elasticsearch v5 support
1 parent 7fefe12 commit f6449ec

3 files changed

Lines changed: 69 additions & 11 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Needed Configuration in configuration.yml for Elasticsearch 5.x
2+
3+
No special configuration is needed for Elasticsearch 5.x. Nice, isn't it?
4+
5+
But the following can make your life easier:
6+
7+
```
8+
# the following settings secure your cluster
9+
cluster.name: [PUT_YOUR_CUSTOM_NAME_HERE]
10+
node.name: [PUT_YOUR_CUSTOM_NAME_HERE]
11+
network.host: 127.0.0.1
12+
```
13+
14+
**Note:** When using Elasticsearch 5.x changes to the mapping may be needed.
15+
More information on the [mapping in ElasticSearch 5.x](Documentation/ElasticMapping-5.x.md).
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Mapping for Elasticsearch 5.x
2+
3+
In contrast to earlier versions, Elasticsearch has deprecated the `string` type
4+
in version 5. This affects the `index` setting on a field as well.
5+
6+
This package tries to adjust the mapping on-the-fly so you may not need to
7+
adjust anything, but in certain cases knowing what would be correct might help.
8+
9+
## `string` is dead, long live strings
10+
11+
The `string` type was used for different things, namely analyzed content to
12+
be searched as fulltext, as well as in a non-analyzed way for keyword searches.
13+
14+
Thus `string` has been split into the new types `text` and `keyword`. Here is a
15+
"conversion table":
16+
17+
| 2.x | 5.x |
18+
|-------------------------------------------|----------------------------------|
19+
| "type": "string", "index": "no" | "type": "text", "index": false |
20+
| "type": "string"[, "index": "analyzed"] | "type": "text", "index": true |
21+
| "type": "string", "index": "not_analyzed" | "type": "keyword", "index": true |
22+
23+
## Conflicting field types
24+
25+
Something that has been enforced since version 2 of Elasticsearch is the fact
26+
that fields of the same name must have the same type within an index, across
27+
types. See https://www.elastic.co/blog/great-mapping-refactoring#conflicting-mappings.
28+
29+
With the split of `string` into two types, new conflicts of that type may arise.
30+
31+
To fix those conflicts, you may need to rename properties or adjust the mapping
32+
in your node types.

README.md

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,6 @@ main functionalities:
88
* finding Nodes in TypoScript / Eel by arbitrary queries
99
* Full-Text Indexing of Pages and other Documents (of course including the full content)
1010

11-
## Elastic version support
12-
13-
You can switch the Elastic driver by editing ```Settings.yaml```
14-
(```Flowpack.ElasticSearch.ContentRepositoryAdaptor.driver.version```) with the following value:
15-
16-
* ```1.x``` to support Elastic 1.2 to 1.7
17-
* ```2.x``` to support Elastic 2.x
18-
19-
_Currently the Driver interfaces as not marked as API, and can be changed to adapt to future needs (especially the support of Elastic v5)._
20-
2111
## Relevant Packages
2212

2313
* [TYPO3.TYPO3CR.Search](https://www.neos.io/download-and-extend/packages/typo3/typo3-typo3cr-search.html): provides common functionality for searching TYPO3CR nodes,
@@ -43,11 +33,26 @@ Then, ensure to update `<your-elasticsearch>/config/elasticsearch.yml` as explai
4333

4434
Finally, run `./flow nodeindex:build`, and add the search plugin to your page. It should "just work".
4535

46-
## Elasticsearch Configuration file elasticsearch.yml
36+
## Elastic version support
37+
38+
You can switch the Elastic driver by editing ```Settings.yaml```
39+
(```Flowpack.ElasticSearch.ContentRepositoryAdaptor.driver.version```) with the following value:
40+
41+
* ```1.x``` to support Elastic 1.2 to 1.7
42+
* ```2.x``` to support Elastic 2.x
43+
* ```5.x``` to support Elastic 5.x
44+
45+
_Currently the Driver interfaces as not marked as API, and can be changed to adapt to future needs._
46+
47+
**Note:** When using Elasticsearch 5.x changes to the types may need to be done in your mapping.
48+
More information on the [mapping in ElasticSearch 5.x](Documentation/ElasticMapping-5.x.md).
49+
50+
### Elasticsearch Configuration file elasticsearch.yml
4751

4852
There is a need, depending on your version of Elasticsearch, to add specific configuration to your
4953
Elasticsearch Configuration File `<your-elasticsearch>/config/elasticsearch.yml`.
5054

55+
- [ElasticSearch 5.x](Documentation/ElasticConfiguration-5.x.md)
5156
- [ElasticSearch 2.x](Documentation/ElasticConfiguration-2.x.md)
5257
- [ElasticSearch 1.6 to 1.7](Documentation/ElasticConfiguration-1.6-1.7.md)
5358
- [ElasticSearch 1.4 to 1.5](Documentation/ElasticConfiguration-1.4-1.5.md)
@@ -317,6 +322,9 @@ for all your filterable properties, or else filtering won't work on them properl
317322
index: 'not_analyzed'
318323
```
319324

325+
**Note:** When using Elasticsearch 5.x the mapping needs to be adjusted in a different way.
326+
More information on the [mapping in ElasticSearch 5.x](Documentation/ElasticMapping-5.x.md).
327+
320328
## Sorting
321329

322330
This package adapts Elasticsearchs sorting capabilities. You can add multiple sort operations to your query.
@@ -487,6 +495,9 @@ suggestions = ${Search.query(site)...suggestions('my_suggestions', this.suggesti
487495
**The default configuration supports most usecases and often may not need to be touched, as this package comes
488496
with sane defaults for all Neos data types.**
489497

498+
**Note:** When using Elasticsearch 5.x changes to the your mapping may be needed. More information
499+
on the [mapping in ElasticSearch 5.x](Documentation/ElasticMapping-5.x.md).
500+
490501
Indexing of properties is configured at two places. The defaults per-data-type are configured
491502
inside `TYPO3.TYPO3CR.Search.defaultConfigurationPerType` of `Settings.yaml`.
492503
Furthermore, this can be overridden using the `properties.[....].search` path inside

0 commit comments

Comments
 (0)