Skip to content

Commit 2ab16f6

Browse files
Merge pull request #163 from Flowpack/daniellienert-patch-1
TASK: Update Readme
2 parents 7eaa79b + 38e1ab1 commit 2ab16f6

1 file changed

Lines changed: 42 additions & 44 deletions

File tree

README.md

Lines changed: 42 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,31 @@
66

77
Created by Sebastian Kurfürst; [contributions by Karsten Dambekalns, Robert Lemke and others](https://github.com/Flowpack/Flowpack.ElasticSearch.ContentRepositoryAdaptor/graphs/contributors).
88

9-
This project connects the Neos Content Repository (TYPO3CR) to Elasticsearch; enabling two main functionalities:
9+
This project connects the Neos Content Repository to Elasticsearch; enabling two main functionalities:
1010

11-
* finding Nodes in TypoScript / Eel by arbitrary queries
11+
* finding Nodes in Fusion / Eel by arbitrary queries
1212
* Full-Text Indexing of Pages and other Documents (of course including the full content)
1313

1414
## Relevant Packages
1515

16-
* [TYPO3.TYPO3CR.Search](https://www.neos.io/download-and-extend/packages/typo3/typo3-typo3cr-search.html): provides common functionality for searching TYPO3CR nodes,
16+
* [Neos.ContentRepository.Search](https://www.neos.io/download-and-extend/packages/typo3/typo3-typo3cr-search.html): provides common functionality for searching Neos Content Repository nodes,
1717
does not contain a search backend
1818
* [Flowpack.ElasticSearch](https://www.neos.io/download-and-extend/packages/flowpack/flowpack-elasticsearch.html): provides common code for working with Elasticsearch
1919
* [Flowpack.ElasticSearch.ContentRepositoryAdaptor](https://www.neos.io/download-and-extend/packages/flowpack/flowpack-elasticsearch-contentrepositoryadaptor.html): this package
20-
* [Flowpack.SimpleSearch.ContentRepositoryAdaptor](https://www.neos.io/download-and-extend/packages/flowpack/flowpack-simplesearch-contentrepositoryadaptor.html): an alternative search backend (to be used
21-
instead of this package); storing the search index in SQLite
20+
* [Flowpack.SimpleSearch.ContentRepositoryAdaptor](https://www.neos.io/download-and-extend/packages/flowpack/flowpack-simplesearch-contentrepositoryadaptor.html): an alternative search backend (to be used instead of this package); storing the search index in SQLite
2221
* [Flowpack.SearchPlugin](https://www.neos.io/download-and-extend/packages/flowpack/flowpack-searchplugin.html): search plugin for Neos
2322

2423

2524
## Installation
2625

2726
```
28-
composer require 'typo3/typo3cr-search'
27+
composer require 'neos/content-repository-search'
2928
composer require 'flowpack/elasticsearch-contentrepositoryadaptor'
3029
3130
composer require 'flowpack/searchplugin'
3231
```
3332

34-
Now, add the routes as described in the [README of Flowpack.SearchPlugin](https://github.com/skurfuerst/Flowpack.SearchPlugin)
33+
Now, add the routes as described in the [README of Flowpack.SearchPlugin](https://github.com/Flowpack/Flowpack.SearchPlugin)
3534
as the **first route** in Configuration/Routes.yaml.
3635

3736
Then, ensure to update `<your-elasticsearch>/config/elasticsearch.yml` as explained below; then start Elasticsearch.
@@ -96,7 +95,7 @@ If you use multiple client configurations, please change the *default* key just
9695

9796
## Doing Arbitrary Queries
9897

99-
We'll first show how to do arbitrary Elasticsearch Queries in TypoScript. This is a more powerful
98+
We'll first show how to do arbitrary Elasticsearch Queries in Fusion. This is a more powerful
10099
alternative to FlowQuery. In the long run, we might be able to integrate this API back into FlowQuery,
101100
but for now it works well as-is.
102101

@@ -153,25 +152,25 @@ In order to debug the query more easily, the following operation is helpful:
153152
Use Case: On a "Tag Overview" page, you want to show all pages being tagged in a certain way
154153

155154
Setup: You have two node types in a blog called `Acme.Blog:Post` and `Acme.Blog:Tag`, both
156-
inheriting from `TYPO3.Neos:Document`. The `Post` node type has a property `tags` which is
155+
inheriting from `Neos.Neos:Document`. The `Post` node type has a property `tags` which is
157156
of type `references`, pointing to `Tag` documents.
158157

159-
TypoScript setup:
158+
Fusion setup:
160159

161160
```
162161
# for "Tag" documents, replace the main content area.
163-
prototype(TYPO3.Neos:PrimaryContent).acmeBlogTag {
162+
prototype(Neos.Neos:PrimaryContent).acmeBlogTag {
164163
condition = ${q(node).is('[instanceof Acme.Blog:Tag]')}
165164
type = 'Acme.Blog:TagPage'
166165
}
167166
168167
# The "TagPage"
169-
prototype(Acme.Blog:TagPage) < prototype(TYPO3.TypoScript:Collection) {
168+
prototype(Acme.Blog:TagPage) < prototype(Neos.Fusion:Collection) {
170169
collection = ${Search.query(site).nodeType('Acme.Blog:Post').exactMatch('tags', node).sortDesc('creationDate').execute()}
171170
itemName = 'node'
172171
itemRenderer = Acme.Blog:SingleTag
173172
}
174-
prototype(Acme.Blog:SingleTag) < prototype(TYPO3.Neos:Template) {
173+
prototype(Acme.Blog:SingleTag) < prototype(Neos.Neos:Template) {
175174
...
176175
}
177176
```
@@ -239,8 +238,8 @@ fieldBasedAggregation("anotherAggregation", "field", "avg", "colors.avgprice")
239238
To add a custom aggregation you can use the `aggregation()` method. All you have to do is to provide an array with your
240239
aggregation definition. This example would do the same as the fieldBasedAggregation would do for you:
241240
```
242-
aggregationDefinition = TYPO3.TypoScript:RawArray {
243-
terms = TYPO3.TypoScript:RawArray {
241+
aggregationDefinition = Neos.Fusion:RawArray {
242+
terms = Neos.Fusion:RawArray {
244243
field = "color"
245244
}
246245
}
@@ -254,11 +253,11 @@ an NodeTye ProductList with an property `products`. This property contains a com
254253
be a reference on other products.
255254

256255
```
257-
prototype(Vendor.Name:FilteredProductList) < prototype(TYPO3.Neos:Content)
256+
prototype(Vendor.Name:FilteredProductList) < prototype(Neos.Neos:Content)
258257
prototype(Vendor.Name:FilteredProductList) {
259258
260259
// Create SearchFilter for products
261-
searchFilter = TYPO3.TypoScript:RawArray {
260+
searchFilter = Neos.Fusion:RawArray {
262261
sku = ${String.split(q(node).property("products"), ",")}
263262
}
264263
@@ -330,9 +329,9 @@ nodes = ${q(Search.query(site).....sortAsc("title").sortDesc("name").execute())}
330329
331330
# Custom sort operation
332331
333-
geoSorting = TYPO3.TypoScript:RawArray {
334-
_geo_distance = TYPO3.TypoScript:RawArray {
335-
latlng = TYPO3.TypoScript:RawArray {
332+
geoSorting = Neos.Fusion:RawArray {
333+
_geo_distance = Neos.Fusion:RawArray {
334+
latlng = Neos.Fusion:RawArray {
336335
lat = 51.512711
337336
lon = 7.453084
338337
}
@@ -365,9 +364,9 @@ First of all you have to define a property in your NodeTypes.yaml for your node
365364

366365
Query your nodes in your TypoScript:
367366
```
368-
geoSorting = TYPO3.TypoScript:RawArray {
369-
_geo_distance = TYPO3.TypoScript:RawArray {
370-
latlng = TYPO3.TypoScript:RawArray {
367+
geoSorting = Neos.Fusion:RawArray {
368+
_geo_distance = Neos.Fusion:RawArray {
369+
latlng = Neos.Fusion:RawArray {
371370
lat = 51.512711
372371
lon = 7.453084
373372
}
@@ -392,8 +391,8 @@ the `GetHitArrayForNodeViewHelper`:
392391
393392
```
394393

395-
The ViewHelper will use \TYPO3\Flow\Utility\Arrays::getValueByPath() to return a specified path. So you can make use
396-
of an array or a string. Check the documentation \TYPO3\Flow\Utility\Arrays::getValueByPath() for more informations.
394+
The ViewHelper will use \Neos\Utility\Arrays::getValueByPath() to return a specified path. So you can make use
395+
of an array or a string. Check the documentation \Neos\Utility\Arrays::getValueByPath() for more information.
397396

398397
**Important notice**
399398

@@ -421,7 +420,7 @@ and finally one for the plain text (`__fulltext.text`). All of these fields add
421420
Elasticsearch `_all` field, and are configured with different `boost` values.
422421

423422
In order to search this index, you can just search inside the `_all` field with an additional limitation
424-
of `__typeAndSupertypes` containing `TYPO3.Neos:Document`.
423+
of `__typeAndSupertypes` containing `Neos.Neos:Document`.
425424

426425
**For a search user interface, checkout the Flowpack.SearchPlugin package**
427426

@@ -459,10 +458,10 @@ You can access your suggestions inside your fluid template with
459458
Phrase query that returns query suggestions
460459

461460
```
462-
suggestionsQueryDefinition = TYPO3.TypoScript:RawArray {
461+
suggestionsQueryDefinition = Neos.Fusion:RawArray {
463462
text = 'some Text'
464-
simple_phrase = TYPO3.TypoScript:RawArray {
465-
phrase = TYPO3.TypoScript:RawArray {
463+
simple_phrase = Neos.Fusion:RawArray {
464+
phrase = Neos.Fusion:RawArray {
466465
analyzer = 'body'
467466
field = 'bigram'
468467
size = 1
@@ -480,7 +479,7 @@ suggestions = ${Search.query(site)...suggestions('my_suggestions', this.suggesti
480479
with sane defaults for all Neos data types.**
481480

482481
Indexing of properties is configured at two places. The defaults per-data-type are configured
483-
inside `TYPO3.TYPO3CR.Search.defaultConfigurationPerType` of `Settings.yaml`.
482+
inside `Neos.ContentRepository.Search.defaultConfigurationPerType` of `Settings.yaml`.
484483
Furthermore, this can be overridden using the `properties.[....].search` path inside
485484
`NodeTypes.yaml`.
486485

@@ -493,8 +492,8 @@ This configuration contains two parts:
493492
Example (from the default configuration):
494493
```
495494
# Settings.yaml
496-
TYPO3:
497-
TYPO3CR:
495+
Neos:
496+
ContentRepository:
498497
Search:
499498
defaultConfigurationPerType:
500499
@@ -509,7 +508,7 @@ TYPO3:
509508

510509
```
511510
# NodeTypes.yaml
512-
'TYPO3.Neos:Timable':
511+
'Neos.Neos:Timable':
513512
properties:
514513
'_hiddenBeforeDateTime':
515514
search:
@@ -545,7 +544,7 @@ In order to enable fulltext indexing, every `Document` node must be configured a
545544
the following is configured in the default configuration:
546545

547546
```
548-
'TYPO3.Neos:Document':
547+
'Neos.Neos:Document':
549548
search:
550549
fulltext:
551550
isRoot: true
@@ -560,7 +559,7 @@ in `NodeTypes.yaml` at `properties.[propertyName].search.fulltextExtractor`.
560559
An example:
561560

562561
```
563-
'TYPO3.Neos.NodeTypes:Text':
562+
'Neos.Neos.NodeTypes:Text':
564563
properties:
565564
'text':
566565
search:
@@ -614,17 +613,17 @@ If you want to index attachments, you need to install the [Elasticsearch Attachm
614613
Then, you can add the following to your `Settings.yaml`:
615614

616615
```
617-
TYPO3:
618-
TYPO3CR:
616+
Neos:
617+
ContentRepository:
619618
Search:
620619
defaultConfigurationPerType:
621-
'TYPO3\Media\Domain\Model\Asset':
620+
'Neos\Media\Domain\Model\Asset':
622621
elasticSearchMapping:
623622
type: attachment
624623
include_in_all: true
625624
indexing: ${Indexing.indexAsset(value)}
626625
627-
'array<TYPO3\Media\Domain\Model\Asset>':
626+
'array<Neos\Media\Domain\Model\Asset>':
628627
elasticSearchMapping:
629628
type: attachment
630629
include_in_all: true
@@ -644,7 +643,7 @@ Flowpack:
644643
ElasticSearch:
645644
indexes:
646645
default:
647-
'typo3cr': # This index name must be the same as in the TYPO3.TYPO3CR.Search.elasticSearch.indexName setting
646+
'neoscontentrepository': # This index name must be the same as in the Neos.ContentRepository.Search.elasticSearch.indexName setting
648647
analysis:
649648
filter:
650649
elision:
@@ -663,7 +662,7 @@ Then, you can change the analyzers on a per-field level; or e.g. reconfigure the
663662
in the NodeTypes.yaml. Generally this works by defining the global mapping at `[nodeType].search.elasticSearchMapping`:
664663

665664
```
666-
'TYPO3.Neos:Node':
665+
'Neos.Neos:Node':
667666
search:
668667
elasticSearchMapping:
669668
_all:
@@ -684,7 +683,7 @@ In order to understand what's going on, the following commands are helpful:
684683
## Version 2 vs Version 1
685684

686685
* Version 1 is the initial, productive version of the Neos Elasticsearch adapter.
687-
* Version 2 has a dependency on TYPO3.TYPO3CR.Search; which contains base functionality
686+
* Version 2 has a dependency on Neos.ContentRepository.Search; which contains base functionality
688687
which is also relevant for other search implementations (like the SQLite based SimpleSearch).
689688

690689
The configuration from Version 1 to Version 2 has changed; here's what to change:
@@ -693,7 +692,7 @@ The configuration from Version 1 to Version 2 has changed; here's what to change
693692
**Settings.yaml**
694693

695694
1. Change the base namespace for configuration from `Flowpack.ElasticSearch.ContentRepositoryAdaptor`
696-
to `TYPO3.TYPO3CR.Search`. All further adjustments are made underneath this namespace:
695+
to `Neos.ContentRepository.Search`. All further adjustments are made underneath this namespace:
697696
2. (If it exists in your configuration:) Move `indexName` to `elasticSearch.indexName`
698697
3. (If it exists in your configuration:) Move `log` to `elasticSearch.log`
699698
4. search for `mapping` (inside `defaultConfigurationPerType.<typeName>`) and replace it by
@@ -709,4 +708,3 @@ The configuration from Version 1 to Version 2 has changed; here's what to change
709708
`elasticSearchMapping`.
710709
3. Replace `ElasticSeach.fulltext` by `Indexing`
711710
4. Search for `ElasticSearch.` (inside the `indexing` expressions) and replace them by `Indexing.`
712-

0 commit comments

Comments
 (0)