# Semantically equivalent search leads to different results

**URL:** <https://discuss.elastic.co/t/semantically-equivalent-search-leads-to-different-results/240297>\
**Category:** Elasticsearch\
**Created:** [July 8, 2020, 8:23am UTC](https://discuss.elastic.co/t/semantically-equivalent-search-leads-to-different-results/240297 "2020-07-08T08:23:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![puschelfoo](https://avatars.discourse-cdn.com/v4/letter/p/3ab097/32.png) [@puschelfoo](https://discuss.elastic.co/u/puschelfoo)\
**Post date:** [July 8, 2020, 8:23am UTC](https://discuss.elastic.co/t/semantically-equivalent-search-leads-to-different-results/240297/1 "2020-07-08T08:23:38Z")

</div>

Query [1] (exactly one result) and [2] (many results) differ in their results (quantity), although they are semantically equivalent according to the documentation (see "operator" parameter explanation for in [Documentation for "operator" parameter](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query.html)). Is there an explanation for this?

[1]:

```auto
GET test/_search
{
  "query": {
    "match": {
      "fulltext": {
        "query" : "Western United States",
        "operator": "and"
      }
    }
  }
}

```

[2]:

```auto
GET test/_search
{
  "query": {
    "match": {
      "fulltext": {
        "query" : "Western AND United AND States"
      }
    }
  }
}

```

---

<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:** [July 8, 2020, 10:09am UTC](https://discuss.elastic.co/t/semantically-equivalent-search-leads-to-different-results/240297/2 "2020-07-08T10:09:05Z")

</div>

The link you shared is about the `query_string` query if I'm not mistaken and not about the `match` query. This should be equivalent I believe

```
GET /_search
{
    "query": {
        "query_string" : {
            "query" : "Western AND United AND States",
            "default_field" : "fulltext"
        }
    }
}

```

or

```
GET /_search
{
    "query": {
        "query_string" : {
            "query" : "fulltext:Western AND fulltext:United AND fulltext:States"
        }
    }
}
```

---

<div class="post-metadata">

**Author:** ![puschelfoo](https://avatars.discourse-cdn.com/v4/letter/p/3ab097/32.png) [@puschelfoo](https://discuss.elastic.co/u/puschelfoo)\
**Post date:** [July 8, 2020, 10:48am UTC](https://discuss.elastic.co/t/semantically-equivalent-search-leads-to-different-results/240297/3 "2020-07-08T10:48:50Z")

</div>

Thank you! The link was wrong, I corrected it.  
Beyond that, however, the question remains...

---

<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:** [July 8, 2020, 10:15pm UTC](https://discuss.elastic.co/t/semantically-equivalent-search-leads-to-different-results/240297/4 "2020-07-08T22:15:13Z")

</div>

You can't use `AND` operator in the `match` query as I said before.

---

<div class="post-metadata">

**Author:** ![puschelfoo](https://avatars.discourse-cdn.com/v4/letter/p/3ab097/32.png) [@puschelfoo](https://discuss.elastic.co/u/puschelfoo)\
**Post date:** [July 9, 2020, 5:13am UTC](https://discuss.elastic.co/t/semantically-equivalent-search-leads-to-different-results/240297/5 "2020-07-09T05:13:06Z")

</div>

Now I understand, thanks for your help! 🙂

---

<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:** [August 6, 2020, 5:13am UTC](https://discuss.elastic.co/t/semantically-equivalent-search-leads-to-different-results/240297/6 "2020-08-06T05:13:12Z")

</div>

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