https://github.com/intracto/elastic-synonym-bundle
https://github.com/intracto/elastic-synonym-bundle
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/intracto/elastic-synonym-bundle
- Owner: Intracto
- License: mit
- Created: 2021-09-15T12:25:20.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-03-21T12:29:01.000Z (over 4 years ago)
- Last Synced: 2025-01-02T20:19:16.864Z (over 1 year ago)
- Language: PHP
- Size: 14.6 KB
- Stars: 0
- Watchers: 7
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Intracto Elastic Synonym
============
This bundle integrates `intracto/elastic-synonym` into your application. The views are build using bootstrap 4.
Installation
============
```console
$ composer require intracto/elastic-synonym-bundle
```
Prepare your project
========================
See `intracto/elastic-synonym` to prepare your project for this bundle.
Configuration
=============
```yaml
# packages/intracto_elastic_synonym.yaml
intracto_elastic_synonym:
synonym_configs:
default: # unique config identifier
name: Synonyms # user-friendly name
file: '%env(string:INTRACTO_ELASTIC_SYNONYM_DIR)%synonyms.txt' # absolute path to synonym file [only configs with valid files will be accessible]
indices: ["index"] # array of all indices (or aliases) that need to be refreshed on change
```
```
# .env
###> INTRACTO ELASTIC SYNONYM ###
INTRACTO_ELASTIC_SYNONYM_DIR=/vagrant/.elastic-synonym/
###> INTRACTO ELASTIC SYNONYM ###
```
Routes
======
The available actions can be added to your routing manually, or you can include and prefix the default:
```yaml
# routes/intracto_elastic_synonym.yaml
_intracto_elastic_synonym_bundle:
resource: '@IntractoElasticSynonymBundle/Resources/config/routes.xml'
prefix: /elastic
```
Security
========
This bundle is supposed to be behind authentication, you may enforce this any way you want.
Override layout
===============
The layout can be overridden by creating the file `templates/bundles/IntractoElasticSynonymBundle/base.html.twig`.
Just make sure to implement `{% block intracto_elastic_synonym_content %}{% endblock %}`.
Example:
```twig
{% extends 'base.html.twig' %}
{% trans_default_domain 'IntractoElasticSynonym' %}
{% block title %}{{ 'config.index.title'|trans }}{% endblock %}
{% block body %}
{% block intracto_elastic_synonym_content %}{% endblock %}
{% endblock %}
```