# Confused about Explicit Mapping in Synonym Graph

**URL:** <https://discuss.elastic.co/t/confused-about-explicit-mapping-in-synonym-graph/294368>\
**Category:** Elasticsearch\
**Created:** [January 14, 2022, 6:35am UTC](https://discuss.elastic.co/t/confused-about-explicit-mapping-in-synonym-graph/294368 "2022-01-14T06:35:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![learningmore](https://avatars.discourse-cdn.com/v4/letter/l/cdc98d/32.png) [@learningmore](https://discuss.elastic.co/u/learningmore)\
**Post date:** [January 14, 2022, 6:35am UTC](https://discuss.elastic.co/t/confused-about-explicit-mapping-in-synonym-graph/294368/1 "2022-01-14T06:35:31Z")

</div>

I've read the document on [Synonym Graph](https://www.elastic.co/guide/en/elasticsearch//reference/current/analysis-synonym-graph-tokenfilter.html), but I am still confused about explicit mapping.

Assume that we have the following data:

```auto
horse
mouse
chicken
rooster
duck
cow

```

Let's assume the synonym file has the following entries:

```auto
cow=>duck

```

I am using **Index-time synonyms**. I am expecting if I search for `cow`, I will only get `duck`. If I search for `duck`, I will also only get `duck`. But that's not the case.

**Query** : **PREFIX** query to search for `cow`  
**Expected result** : `duck` _only_  
**Actual Result** : No result!!

**Query** : **PREFIX** query to search for `duck`  
**Expected result** : `duck` _only_  
**Actual Result** : both `cow` and `duck`

```auto
"query": {
    "prefix": {
      "animal": "cow" (or change it to "duck")
  }
}

```

Why is it that when searching for `cow`, I get no results, and when searching for `duck`, both `cow` and `duck` are returned? Is my understanding incorrect?

For good measures, I did **MATCH** query on `cow` and `duck` as well. Both returned `cow` and `duck`. Still not what I was expecting.

```auto
"query": {
    "match": {
      "animal": "cow" (or change it to "duck")
  }
}

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 11, 2022, 6:35am UTC](https://discuss.elastic.co/t/confused-about-explicit-mapping-in-synonym-graph/294368/2 "2022-02-11T06:35:32Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
