mixailshaulsky / elasticsearch-bundle
Elasticsearch bundle for Symfony.
Installs: 2
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 189
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^7.1
- doctrine/annotations: ^1.6
- doctrine/cache: ^1.7
- doctrine/collections: ^1.5
- doctrine/inflector: ^1.3
- elasticsearch/elasticsearch: ^6.0
- monolog/monolog: ^1.24
- ongr/elasticsearch-dsl: ^6.0
- symfony/cache: ^3.4|^4.1
- symfony/console: ^3.4|^4.1
- symfony/dependency-injection: ^3.4|^4.1
- symfony/finder: ^3.4|^4.1
- symfony/framework-bundle: ^3.4|^4.1
- symfony/property-access: ^3.4|^4.1
- symfony/serializer: ^3.4|^4.1
- symfony/stopwatch: ^3.4|^4.1
- symfony/templating: ^3.4|^4.1
Requires (Dev)
- mikey179/vfsstream: ~1.6
- php-coveralls/php-coveralls: ^2.1
- phpunit/phpunit: ^7.0
- squizlabs/php_codesniffer: ^3.0
- symfony/browser-kit: ^3.4|^4.1
- symfony/expression-language: ^3.4|^4.1
- symfony/options-resolver: ^3.4|^4.1
- symfony/twig-bundle: ^3.4|^4.1
- symfony/validator: ^3.4|^4.1
- symfony/yaml: ^3.4|^4.1
- dev-master / 6.2.x-dev
- 6.1.x-dev
- v6.1.0-beta
- 6.0.x-dev
- v6.0.4
- v6.0.3
- v6.0.2
- v6.0.1
- v6.0.0
- v6.0.0-beta2
- v6.0.0-beta
- 5.2.x-dev
- v5.2.5
- v5.2.4
- v5.2.3
- v5.2.2
- v5.2.1
- v5.2.0
- v5.0.7
- v5.0.6
- v5.0.5
- v5.0.4
- v5.0.3
- v5.0.2
- v5.0.1
- v5.0.0
- v5.0.0-rc3
- v5.0.0-rc2
- v5.0.0-rc1
- v1.2.10
- v1.2.9
- v1.2.8
- v1.2.7
- v1.2.6
- v1.2.5
- v1.2.4
- v1.2.3
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- v1.0.0-alpha.7
- v1.0.0-alpha.6
- v1.0.0-alpha.5
- v1.0.0-alpha.4
- v1.0.0-alpha.3
- v1.0.0-alpha.2
- v1.0.0-alpha.1
- v0.10.8
- v0.10.7
- v0.10.6
- v0.10.5
- v0.10.4
- v0.10.3
- v0.10.2
- v0.10.1
- v0.10.0
- v0.9.4
- v0.9.3
- v0.9.2
- v0.9.1
- v0.9.0
- v0.8.3
- v0.8.2
- v0.8.1
- v0.8.0
- v0.7.0
- v0.6.0
- v0.5.1
- v0.5.0
- v0.4.1
- v0.4.0
- v0.3.0
- v0.2.0
- v0.1.0
- dev-es7_support
This package is not auto-updated.
Last update: 2024-11-22 10:15:50 UTC
README
This is the fork ONGR Elasticsearch Bundle with ability to customize Index similarity
Step 1: Configure bundle
# config/packages/ongr_elasticsearch.yaml ongr_elasticsearch: analysis: filter: edge_ngram_filter: #-> your custom filter name to use in the analyzer below type: edge_ngram min_gram: 1 max_gram: 20 analyzer: eNgramAnalyzer: #-> analyzer name to use in the document field type: custom tokenizer: standard filter: - lowercase - edge_ngram_filter #that's the filter defined earlier similarity: scripted_tfidf: type: scripted script: source: "double tf = Math.sqrt(doc.freq); double idf = 1.0; double norm = 1/Math.sqrt(doc.length); return query.boost * tf * idf * norm;" indexes: App\Document\Product: hosts: [elasticsearch:9200] # optional, the default is 127.0.0.1:9200
Step 2: Configure your custom similarity for Document
field
// src/Document/Product.php namespace App\Document; use ONGR\ElasticsearchBundle\Annotation as ES; /** * //alias and default parameters in the annotation are optional. * @ES\Index(alias="products", default=true) */ class Product { /** * @ES\Id() */ public $id; /** * @ES\Property(type="text", similarity="scripted_tfidf") */ public $title; /** * @ES\Property(type="float") */ public $price; }