Skip to content

Commit 4fb7eb4

Browse files
Add some JanePHP documentation
1 parent efae056 commit 4fb7eb4

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

README.md

+19-1
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,31 @@ When running indexation of lots of documents, this setting allow you to fine-tun
145145

146146
## Using Jane for DTO and fast Normalizers
147147

148-
To write.
148+
Install [JanePHP](https://jane.readthedocs.io/) and the model generator to build your own DTO and Normalizers. Then create your Serializer like this:
149+
150+
```php
151+
$normalizers = \Elasticsearch\Normalizer\NormalizerFactory::create();
152+
$encoders = [
153+
new JsonEncoder(
154+
new JsonEncode([JsonEncode::OPTIONS => \JSON_UNESCAPED_SLASHES]),
155+
new JsonDecode([JsonDecode::ASSOCIATIVE => false])
156+
)
157+
];
158+
159+
$serializer = new Serializer($normalizers, $encoders);
160+
161+
$client = new Client([
162+
Client::CONFIG_SERIALIZER => $serializer,
163+
]);
164+
```
149165

150166
## To be done
151167

152168
- some "todo" in the code
169+
- serializer options (by index?!)
153170
- optional Doctrine connector
154171
- better logger
172+
- travis-ci setup
155173
- optional Symfony integration (DIC)
156174
- web debug toolbar!
157175
- scripts / commands for common tasks:

0 commit comments

Comments
 (0)