# Integration tests for Phonetic analysis components
#
---
"Index phonetic content":
    - do:
        indices.create:
            index:  phonetic_sample
            body:
                settings:
                    index:
                        analysis:
                            analyzer:
                                my_analyzer:
                                    tokenizer:  standard
                                    filter: ["lowercase", "my_metaphone"]
                            filter:
                                my_metaphone:
                                    type: phonetic
                                    encoder: metaphone
                                    replace: false
                mappings:
                    properties:
                        text:
                            type:     text
                            analyzer: my_analyzer

    - do:
        index:
            index:  phonetic_sample
            id:     "1"
            body:   { "text": "hello world" }
    - do:
        indices.refresh: {}

    - do:
        search:
            rest_total_hits_as_int: true
            index: phonetic_sample
            body:
                query:
                    match:
                        text: helllo
    - match: { hits.total: 1 }
