Skip to content

Commit f94d71e

Browse files
einorlersaimaz
authored andcommitted
Docs (#99)
* updated the documentation of the bundle * added changelog
1 parent 9b7dd3a commit f94d71e

File tree

3 files changed

+28
-22
lines changed

3 files changed

+28
-22
lines changed

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# CHANGELOG
2+
3+
## v2.0.0 (2017-03-23)
4+
5+
### Breaking Changes
6+
- Drop PHP 5.5 support. Now only PHP >=5.6 are supported.
7+
- Drop Symfony 2.7 support. Now only Symfony >=2.8 are supported.
8+
- Drop Elasticsearch 2.x support. Now only Elasticsearch >=5.0 are supported.
9+
10+
## v1.0.2 (2016-10-03)
11+
- BUGFIX In compiler pass tags are already processed, so it has to be set in the extension. #96
12+
13+
## v1.0.1 (2016-10-03)
14+
- Introduced option to disable router alias. This is because if a user already replaces Symfony router by alias and it conflicts with ONGR alias. #91
15+
- `DocumentUrlGenerator::support()` function cannot throw exception due to `VersatileGeneratorInterface` interface description. Now it returns false instead. #92
16+
17+
## v1.0.0 (2016-04-05)
18+
- Initial release

README.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,6 @@ ongr_elasticsearch:
7272
connections:
7373
default:
7474
index_name: acme
75-
analysis:
76-
analyzer:
77-
- urlAnalyzer
7875
managers:
7976
default:
8077
connection: default
@@ -95,9 +92,6 @@ ongr_router:
9592
9693
In the configuration of the bundle you need to specify the `es.manager` to use and under the `seo_routes` you have to specify documents that will have seo_routes as keys and the controller action that will handle the request as a values.
9794

98-
At `_controller` you define controller and action for every document type.
99-
`_route` is a name of this route and it can be used at path generation.
100-
10195
`urlAnalyzer` at `ongr_elasticsearch` configuration defines how all url fields are analyzed by Elasticsearch.
10296

10397
If you are using another third party bundle that also has an aliased Symfony router, you may set `disable_alias` to `true`. This
@@ -107,7 +101,7 @@ prevents possible conflicts.
107101
is set to the chain router. It defaults to -100 in order to be called after the standard Symfony router
108102
but this value can be changed depending on your projects' need.
109103

110-
Check [Elasticsearch bundle mappings docs](https://github.com/ongr-io/ElasticsearchBundle/blob/master/Resources/doc/mapping.md) for more information about the configuration.
104+
Check [Elasticsearch bundle mappings docs](http://docs.ongr.io/ElasticsearchBundle/mapping) for more information about the configuration.
111105

112106

113107
## Usage example
@@ -133,7 +127,7 @@ class Product implements SeoAwareInterface
133127
use SeoAwareTrait; // <- Trait for URL's
134128
135129
/**
136-
* @ES\Property(type="string")
130+
* @ES\Property(type="keyword")
137131
*/
138132
public $title;
139133
@@ -175,7 +169,7 @@ Create an elasticsearch index by running this command in your terminal:
175169
176170
```
177171
178-
> More info about all commands can be found in the [Elasticsearch bundle commands chapter](https://github.com/ongr-io/ElasticsearchBundle/blob/master/Resources/doc/commands.md).
172+
> More info about all commands can be found in the [Elasticsearch bundle commands chapter](http://docs.ongr.io/ElasticsearchBundle/commands).
179173
180174
Also, run the following curl command in your terminal to insert a product for this demonstration.
181175
Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
1-
# ONGR Router Bundle
1+
# How it works
22

3-
Welcome to the RouterBundle, the part of ONGR bundles family, which helps to have pretty urls for every elasticsearch document. We created this bundle with love :heart: and we think you will love it too.
3+
## URL generation
44

5-
> You can find bundle set up guide in the [`README.md`](../../README.md) file.
6-
7-
## How it works
8-
9-
### URL generation
10-
11-
When your document uses [SeoAwareTrait](https://github.com/ongr-io/RouterBundle/blob/master/Document/SeoAwareTrait.php) you have protected property called `$url`. It contains the url for specific document,which is used for url generation.
5+
When your document uses [SeoAwareTrait](https://github.com/ongr-io/RouterBundle/blob/master/Document/SeoAwareTrait.php) you have private property called `$url`. It contains the url for specific document,which is used for url generation.
126

137
Your document must be defined in the configuration of the bundle, under the node `seo_routes`. There you will define the bundle, controller and action that will be called after the router matches the route in your document.
148

@@ -27,16 +21,16 @@ In order to generate link to this document (referenced by variable `product`) we
2721

2822
> The route `ongr_route_product` is generated from `seo_routes` parameter type name, so it's formed by: `ongr_route_<type-name>`.
2923
30-
### URL matching
24+
## URL matching
3125

32-
As shown in [README example](../../README.md#step-4-create-an-action-for-product-page) when url matches document, real object representing document is passed to action instead of original string from URI. This is how it works:
26+
As shown in [README example](http://docs.ongr.io/RouterBundle) when url matches document, real object representing document is passed to action instead of original string from URI. This is how it works:
3327
- Symfony chain router begins to parse request.
3428
- By default there are two routers registered in the chain: standard Symfony router and ONGR router.
3529
- If Symfony router does not match any routes for given URI it is passed to ONGR router.
3630
- ONGR router queries ES to get document by URI.
3731
- If query returned document it is passed to action, if not - NotFound exception is thrown.
3832

39-
> Note that it is default behaviour and it can be easily changed by adding and removing routers from chain. [More info](chain_router.md)
33+
> Note that it is default behaviour and it can be easily changed by adding and removing routers from chain. [More info](http://docs.ongr.io/RouterBundle/chain_router)
4034
4135
## Advanced usage
42-
* [How to add custom router](chain_router.md)
36+
* [How to add custom router](http://docs.ongr.io/RouterBundle/chain_router)

0 commit comments

Comments
 (0)