Skip to content

A Index Storage Extension for Pimcore Dynamic Search. Store data with the elasticsearch index service.

License

Notifications You must be signed in to change notification settings

simonkey/pimcore-dynamic-search-index-provider-elasticsearch

 
 

Repository files navigation

Dynamic Search | Index Provider: Elasticsearch

Software License Latest Release Tests PhpStan

A Index Storage Extension for Pimcore Dynamic Search. Store data with the elasticsearch index service.

Requirements

  • Pimcore >= 6.6
  • Symfony >= 4.4
  • Pimcore Dynamic Search 1.0

Basic Setup

dynamic_search:
    enable_pimcore_element_listener: true
    context:
        default:
            index_provider:
                service: 'elasticsearch'
                options:
                    index:
                        identifier: 'default'
                        hosts:
                            - 'elasticsearch:9200'
                        settings: []
                        credentials: # optional, empty array
                            username: '%ES_USERNAME%'
                            password: '%ES_PASSWORD%'
                    analysis:
                        analyzer:
                            keyword_analyzer:
                                tokenizer: keyword
                                type: custom
                                filter:
                                    - lowercase
                                    - asciifolding
                                    - trim
                                char_filter: []
                            edge_ngram_analyzer:
                                tokenizer: edge_ngram_tokenizer
                                filter:
                                    - lowercase
                            edge_ngram_search_analyzer:
                                tokenizer: lowercase
                        tokenizer:
                            edge_ngram_tokenizer:
                                type: edge_ngram
                                min_gram: 2
                                max_gram: 5
                                token_chars:
                                    - letter
            output_channels:
                suggestions:
                    service: 'elasticsearch_search'
                    normalizer:
                        service: 'es_document_raw_normalizer'
                    paginator:
                        enabled: false
                search:
                    service: 'elasticsearch_search'
                    use_frontend_controller: true
                    options:
                        result_limit: 10
                    normalizer:
                        service: 'es_document_source_normalizer'
                    paginator:
                        enabled: true
                        max_per_page: 10

Provider Options

Name Default Value Description
index []
analysis []

Index Fields

Available Index Fields:

Name Description
dynamic TBD
explicit TBD

Output Channel Services

Search

This channel service just creates a simple DSL search class. You're able to modify the search by hooking via dynamic_search.output_channel.modifier.action into the post_query_build action.

Identifier: elasticsearch_search
Available Options:

Name Default Value Description
result_limit 10

Multi Search

Identifier: TBD
Available Options: none


Filter

TBD

Output Normalizer

A Output Normalizer can be defined for each output channel.

es_document_raw_normalizer

Use this normalizer to get the untouched elasticsearch response.

Available Options:
Currently none

es_document_source_normalizer

Use this normalizer to get all document values (_source) stored in response.hits.hits[]

Available Options:
Currently none


Commands

Rebuild Index Mapping

Use this command to rebuild a index by passing your context name with argument -c

Attention! By executing this command, the index gets removed and all data will be lost!

$  bin/console dynamic-search:es:rebuild-index -c default

About

A Index Storage Extension for Pimcore Dynamic Search. Store data with the elasticsearch index service.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 98.0%
  • Twig 2.0%