# Phonetic Analyzer returning no results

**URL:** <https://discuss.elastic.co/t/phonetic-analyzer-returning-no-results/218043>\
**Category:** Elasticsearch\
**Created:** [February 5, 2020, 6:26pm UTC](https://discuss.elastic.co/t/phonetic-analyzer-returning-no-results/218043 "2020-02-05T18:26:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![abhijith\_chandran](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abhijith_chandran/32/60470_2.png) [@abhijith\_chandran](https://discuss.elastic.co/u/abhijith_chandran)\
**Post date:** [February 5, 2020, 6:26pm UTC](https://discuss.elastic.co/t/phonetic-analyzer-returning-no-results/218043/1 "2020-02-05T18:26:29Z")

</div>

Using the built-in plugin in AWS - [https://aws.amazon.com/about-aws/whats-new/2016/12/amazon-elasticsearch-service-now-supports-phonetic-analysis/](https://aws.amazon.com/about-aws/whats-new/2016/12/amazon-elasticsearch-service-now-supports-phonetic-analysis/).

Before indexing, I used this code to set up the phonetic analyzer.

```auto
PUT enpoint/courts_2
{
  "settings": {
    "index": {
      "analysis": {
        "analyzer": {
          "my_analyzer": {
            "tokenizer": "standard",
            "filter": [
              "lowercase",
              "my_metaphone"
            ]
          }
        },
        "filter": {
          "my_metaphone": {
            "type": "phonetic",
            "encoder": "metaphone",
            "replace": true
          }
        }
      }
    }
  }
}

```

Note: I have not downloaded it specifically as AWS has it pre-built (Check above link).  
Now,  
I am using this code to make the query to the endpoint -

```auto
{
    "query": {
        "multi_match" : {
            "query" : "Abhijith",
            "fields" : ["content", "title^10"],
             "analyzer": "my_analyzer"

        }
    },
     "size": "1",
     "_source": ["title", "bench", "court"],
     "highlight": {
        "fields" : {
            "title" : {},
            "content":{}
        }
    }

}

```

But I am getting zero results back. I am getting the below output:

```auto
{
    "took": 1,
    "timed_out": false,
    "_shards": {
        "total": 5,
        "successful": 5,
        "skipped": 0,
        "failed": 0
    },
    "hits": {
        "total": {
            "value": 0,
            "relation": "eq"
        },
        "max_score": null,
        "hits": []
    }
}

```

I can confirm that when not using the analyzer, I am getting back hits.

When I use this code, it returns normal output though.

```auto
GET courts_2/_analyze
{
  "analyzer": "my_analyzer",
  "text": "Abhijith"
}

```

**Response**

```auto
{
    "tokens": [
        {
            "token": "ABHJ",
            "start_offset": 0,
            "end_offset": 8,
            "type": "<ALPHANUM>",
            "position": 0
        }
    ]
}

```

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 5, 2020, 7:46pm UTC](https://discuss.elastic.co/t/phonetic-analyzer-returning-no-results/218043/2 "2020-02-05T19:46:49Z")

</div>

This looks like a duplicate of [How to use phonetic analyzer using AWS Elasticsearch?](https://discuss.elastic.co/t/how-to-use-phonetic-analyzer-using-aws-elasticsearch/218008/5)

Let's keep the conversation in one single place as it's related.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 5, 2020, 7:46pm UTC](https://discuss.elastic.co/t/phonetic-analyzer-returning-no-results/218043/3 "2020-02-05T19:46:55Z")

</div>


