Skip to content

Commit

Permalink
improve logging, resolves #40
Browse files Browse the repository at this point in the history
  • Loading branch information
solverat committed Dec 16, 2021
1 parent 71dbe9c commit bbaefd7
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 30 deletions.
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ There are several data- and index providers available:
- [Elastic Search](https://github.com/dachcom-digital/pimcore-dynamic-search-index-provider-elasticsearch) | Index data with an elasticsearch instance.
- _apisearch.io_ | _coming soon_

### Installation
## Installation

```json
"require" : {
Expand All @@ -47,6 +47,21 @@ There are several data- and index providers available:
You need at least one data- and one index provider. They have to be installed separately.
Please check out install instruction of each provider (see list above).

## Add Routes
```yaml
# app/config/routing.yml
dynamic_search_frontend:
resource: '@DynamicSearchBundle/Resources/config/pimcore/routing/frontend_routing.yml'
```
## Dispatch Dynamic Search
After you've added [a definition](docs/0_ExampleSetup.md), you're ready to start the engine.
Always use the verbose `-v` flag, otherwise you won't get any process information about the ongoing data / index providing process.

```bash
$ bin/console dynamic-search:run -v
```

## Further Information
![image](https://user-images.githubusercontent.com/700119/146414238-ad2964e6-e873-4607-a89b-bc2ec2e5b95c.png)

Expand Down
9 changes: 5 additions & 4 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Migrating from Version 1.x to Version 2.0.0

### Global Changes
- Directory `var/bundles/DynamicSearchBundle` can be removed safely since it is not required anymore
- PHP8 return type declarations added: you may have to adjust your extensions accordingly
- All Folders in `views` are lowercase/dashed now (`views/common`, `views/output-channel`, ...)
- `FieldTransformerInterface::configureOptions` return type changed to `void`
Expand All @@ -16,18 +17,18 @@
- `setCurrentPageNumber()` added
- `dynamic_search_default_paginator_class` container parameter removed. If you want to modify the paginator items, just us
the `knp_pager.items` event
- `views/common/list/paginated/_wrapper.html.twig`, `views/common/pagination/_default.html.twig` mark-up changed, check your views
accordingly
- `views/common/list/paginated/_wrapper.html.twig`, `views/common/pagination/_default.html.twig` mark-up changed, check your views accordingly
- Resource (Untrusted/Proxy) validation has been removed, you need to use the [resource validator](docs/40_ResourceValidator.md) now:
- Methods `checkUntrustedResourceProxy` and `validateUntrustedResource` from `DataProviderInterface` has been removed. Use `DataProviderValidationAwareInterface::validateResource` instead.
- Methods `checkUntrustedResourceProxy` and `validateUntrustedResource` from `ResourceValidatorInterface` has been removed.
- Class `ProxyResource` has been removed.
- Logfile has been moved to symphony's default log base

### Fixes
--
- Improve Logger [#40](https://github.com/dachcom-digital/pimcore-dynamic-search/issues/40)

### New Features
- Settings panel added.
- Introducing backend panel and HealthState [#34](https://github.com/dachcom-digital/pimcore-dynamic-search/issues/34)

***

Expand Down
36 changes: 14 additions & 22 deletions docs/0_ExampleSetup.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,9 @@
# Example Setup

### composer.json
```json
"require" : {
"dachcom-digital/dynamic-search": "~2.0.0",
"dachcom-digital/dynamic-search-data-provider-trinity": "~2.0.0",
"dachcom-digital/dynamic-search-index-provider-lucene": "~2.00",
}
```

### app/config/routing.yml
```yaml
dynamic_search_frontend:
resource: '@DynamicSearchBundle/Resources/config/pimcore/routing/frontend_routing.yml'
```
## Configuration

### app/config/config.yml
```yaml

# app/config/config.yml
services:

App\DynamicSearch\IndexDefinition\Trinity\Definition:
Expand All @@ -27,9 +13,11 @@ services:
dynamic_search:

context:


# set a context with name "default"
default:


# set data provider
data_provider:
service: 'trinity_data'
options:
Expand All @@ -42,18 +30,21 @@ dynamic_search:
full_dispatch:
object_limit: 20
document_limit: 10

normalizer:
service: 'trinity_localized_resource_normalizer'


# set index provider
index_provider:
service: 'lucene'
options:
database_name: 'my_index_database'

# build output channels
output_channels:

autocomplete:
service: 'lucene_autocomplete'

suggestions:
service: 'lucene_suggestions'
#options:
Expand All @@ -63,6 +54,7 @@ dynamic_search:
service: 'lucene_document_key_value_normalizer'
#options:
# skip_fields: ['title']

search:
service: 'lucene_search'
internal: false
Expand All @@ -75,6 +67,7 @@ dynamic_search:
service: 'lucene_document_key_value_normalizer'
#options:
# skip_fields: ['title']

multi_search:
multiple: true
service: 'lucene_multi_search'
Expand All @@ -87,10 +80,9 @@ dynamic_search:

```

### App\DynamicSearch\IndexDefinition\Trinity\Definition.php
## Definition
```php
<?php

namespace App\DynamicSearch\IndexDefinition\Trinity;

use DynamicSearchBundle\Document\Definition\DocumentDefinitionBuilderInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

class SettingsController extends AdminController
{
public function healStateAction(HealthStateRegistryInterface $healthStateRegistry): JsonResponse
public function healthStateAction(HealthStateRegistryInterface $healthStateRegistry): JsonResponse
{
$stateLines = [];
foreach ($healthStateRegistry->all() as $healthStateService) {
Expand Down
3 changes: 2 additions & 1 deletion src/DynamicSearchBundle/Resources/config/pimcore/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ monolog:
dynamic_search_console_logging:
type: console
verbosity_levels:
VERBOSITY_NORMAL: DEBUG
VERBOSITY_QUIET: EMERGENCY
VERBOSITY_NORMAL: EMERGENCY
VERBOSITY_VERBOSE: DEBUG
VERBOSITY_VERY_VERBOSE: DEBUG
VERBOSITY_DEBUG: DEBUG
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dynamic_search.controller.admin.get_state:
path: /admin/dynamic-search/settings/health-state
defaults: { _controller: DynamicSearchBundle\Controller\Admin\SettingsController::healStateAction }
defaults: { _controller: DynamicSearchBundle\Controller\Admin\SettingsController::healthStateAction }
dynamic_search.controller.admin.get_provider:
path: /admin/dynamic-search/settings/provider
defaults: { _controller: DynamicSearchBundle\Controller\Admin\SettingsController::providerAction }
Expand Down

0 comments on commit bbaefd7

Please sign in to comment.