Skip to content

Commit d5513b5

Browse files
committed
updated documentation
1 parent e3ec1f7 commit d5513b5

18 files changed

Lines changed: 5759 additions & 941 deletions

doc/00_quick_start.md

Lines changed: 365 additions & 357 deletions
Large diffs are not rendered by default.

doc/01_intro.md

Lines changed: 105 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,63 +2,63 @@
22

33
## Install
44

5-
Use composer `composer require spameri/elastic`
5+
Use composer: `composer require spameri/elastic`
66

77
## Usage
88

9-
### 1. Config ElasticSearch
9+
### 1. Configure ElasticSearch
1010

11-
In your config neon, enable extensions. Kdyby/Console is there because we need it to do some command line commands.
11+
In your config neon, enable the extension:
1212

13-
```yaml
13+
```neon
1414
extensions:
15-
spameriElasticSearch: \Spameri\Elastic\DI\SpameriElasticSearchExtension
15+
spameriElasticSearch: \Spameri\Elastic\DI\SpameriElasticSearchExtension
1616
```
1717

18-
Optionaly you need some Symfony Console implementation ie:
18+
Optionally add a Symfony Console implementation:
1919

20-
`````yaml
20+
```neon
2121
extensions:
22-
console: Kdyby\Console\DI\ConsoleExtension
23-
`````
22+
console: Contributte\Console\DI\ConsoleExtension
23+
```
24+
25+
Then configure your ElasticSearch connection:
2426

25-
Then configure where is your ElasticSearch.
2627
```neon
2728
spameriElasticSearch:
28-
host: 127.0.0.1
29-
port: 9200
29+
host: 127.0.0.1
30+
port: 9200
3031
```
3132

32-
For more config options see default values in `\Spameri\Elastic\DI\SpameriElasticSearchExtension::$defaults`. [Here](../src/DI/ElasticSearchExtension.php#L9).
33+
For more config options see [Configuration Guide](02_configuration.md).
34+
35+
#### Raw Client Usage
36+
37+
After configuration you can use ElasticSearch directly:
3338

34-
#### Raw client usage
35-
- After this configuration you are ready to use ElasticSearch in your Nette application.
36-
- Where needed just inject `\Spameri\Elastic\ClientProvider` and then directly call what you need, like this:
3739
```php
3840
$result = $this->clientProvider->client()->search(
39-
(
40-
new \Spameri\ElasticQuery\Document(
41-
$index,
42-
new \Spameri\ElasticQuery\Document\Body\Plain(
43-
$elasticQuery->toArray()
44-
)
45-
)
46-
)->toArray()
41+
(
42+
new \Spameri\ElasticQuery\Document(
43+
$index,
44+
new \Spameri\ElasticQuery\Document\Body\Plain(
45+
$elasticQuery->toArray()
46+
)
47+
)
48+
)->toArray()
4749
);
4850
```
49-
- [Client](https://github.com/elastic/elasticsearch-php/blob/master/src/Elasticsearch/Client.php) is provided from **elasticsearch/elasticsearch** and you can see their [documentation](https://github.com/elastic/elasticsearch-php#quickstart)
50-
what methods and arrays are supported.
51-
- When in doubt what how many arrays or how many arguments **match** supports use [Spameri/ElasticQuery](https://github.com/Spameri/ElasticQuery/blob/master/doc/02-query-objects.md)
52-
- This is library used in later examples. But direct approach is also possible.
51+
52+
The client is provided by **elasticsearch/elasticsearch**. See their [documentation](https://github.com/elastic/elasticsearch-php#quickstart).
53+
54+
For type-safe queries use [Spameri/ElasticQuery](https://github.com/Spameri/ElasticQuery/blob/master/doc/02-query-objects.md).
5355

5456
---
5557

56-
### 2. First entity
58+
### 2. First Entity
5759

5860
#### [Create entity class](03_entity_class.md)
5961

60-
#### [Create entity service](12_entity_service.md)
61-
6262
#### [Create entity factory](11_entity_factory.md)
6363

6464
---
@@ -69,35 +69,103 @@ what methods and arrays are supported.
6969

7070
---
7171

72-
### 4. Fill with data
72+
### 4. Fill with Data
7373

7474
#### [Create and save entity](06_fill_data.md)
7575

7676
#### [Saving process explained](07_save_explained.md)
7777

7878
---
7979

80-
### 5. Get data from ElasticSearch
80+
### 5. Get Data from ElasticSearch
8181

8282
#### [Get data by ID](08_basic_get.md)
8383

8484
#### [Get data by tag](13_advanced_get.md)
8585

8686
---
8787

88-
### 6. Filter data from ElasticSearch
88+
### 6. Filter Data from ElasticSearch
8989

9090
#### [Match data](09_match_get.md)
9191

9292
---
9393

94-
### 7. Aggregate data from ElasticSearch
94+
### 7. Aggregate Data from ElasticSearch
9595

9696
#### [Aggregate data](10_aggregate.md)
9797

9898
---
9999

100-
### x. Other
100+
### 8. Advanced Topics
101+
102+
#### Core Concepts
101103

102-
#### [Data interfaces](04_data_interfaces.md)
104+
- [Data interfaces](04_data_interfaces.md) - Entity and collection interfaces
105+
- [Value Objects](22_value_objects.md) - Type-safe value objects
106+
- [Identity Map](21_identity_map.md) - Entity caching and reference integrity
107+
- [STI Guide](20_sti_guide.md) - Single Table Inheritance
108+
109+
#### Reference Documentation
110+
111+
- [EntityManager](17_entity_manager.md) - Central API for entity operations
112+
- [Model Services](14_model_services.md) - Low-level service API
113+
- [Mapping Attributes](18_mapping_attributes.md) - Property annotations
114+
- [Event System](19_event_system.md) - Lifecycle events and listeners
115+
116+
#### Operations
117+
118+
- [Console Commands](23_console_commands.md) - CLI command reference
119+
- [Import System](15_import_system.md) - Bulk data imports
120+
- [Migrations](24_migrations.md) - Index and data migrations
121+
- [Debugging](16_debugging.md) - Tracy panel and troubleshooting
122+
123+
---
124+
125+
## Quick Reference
126+
127+
| Task | Documentation |
128+
|------|--------------|
129+
| Configure the library | [02_configuration.md](02_configuration.md) |
130+
| Create an entity | [03_entity_class.md](03_entity_class.md) |
131+
| Set up index mapping | [05_new_index_with_mapping.md](05_new_index_with_mapping.md) |
132+
| Save entities | [06_fill_data.md](06_fill_data.md) |
133+
| Query by ID | [08_basic_get.md](08_basic_get.md) |
134+
| Search with filters | [13_advanced_get.md](13_advanced_get.md) |
135+
| Use aggregations | [10_aggregate.md](10_aggregate.md) |
136+
| Handle events | [19_event_system.md](19_event_system.md) |
137+
| Bulk import | [15_import_system.md](15_import_system.md) |
138+
| Debug queries | [16_debugging.md](16_debugging.md) |
139+
| Migrate indexes | [24_migrations.md](24_migrations.md) |
140+
| CLI commands | [23_console_commands.md](23_console_commands.md) |
141+
142+
---
103143

144+
## Document Index
145+
146+
| # | Document | Description |
147+
|---|----------|-------------|
148+
| 00 | [Quick Start](00_quick_start.md) | Step-by-step tutorial |
149+
| 01 | [Intro](01_intro.md) | This document |
150+
| 02 | [Configuration](02_configuration.md) | DI extension setup |
151+
| 03 | [Entity Class](03_entity_class.md) | Creating entities |
152+
| 04 | [Data Interfaces](04_data_interfaces.md) | Interface reference |
153+
| 05 | [Index with Mapping](05_new_index_with_mapping.md) | Index management |
154+
| 06 | [Fill Data](06_fill_data.md) | Saving entities |
155+
| 07 | [Save Explained](07_save_explained.md) | Persistence internals |
156+
| 08 | [Basic Get](08_basic_get.md) | Get by ID |
157+
| 09 | [Match Get](09_match_get.md) | Text search |
158+
| 10 | [Aggregate](10_aggregate.md) | Aggregations |
159+
| 11 | [Entity Factory](11_entity_factory.md) | Custom factories |
160+
| 13 | [Advanced Get](13_advanced_get.md) | Complex queries |
161+
| 14 | [Model Services](14_model_services.md) | Low-level API |
162+
| 15 | [Import System](15_import_system.md) | Bulk imports |
163+
| 16 | [Debugging](16_debugging.md) | Tracy panel |
164+
| 17 | [EntityManager](17_entity_manager.md) | Central API |
165+
| 18 | [Mapping Attributes](18_mapping_attributes.md) | Property annotations |
166+
| 19 | [Event System](19_event_system.md) | Lifecycle events |
167+
| 20 | [STI Guide](20_sti_guide.md) | Single Table Inheritance |
168+
| 21 | [Identity Map](21_identity_map.md) | Entity caching |
169+
| 22 | [Value Objects](22_value_objects.md) | Type-safe values |
170+
| 23 | [Console Commands](23_console_commands.md) | CLI command reference |
171+
| 24 | [Migrations](24_migrations.md) | Index and data migrations |

0 commit comments

Comments
 (0)