# Match Query with input word order maintain

**URL:** <https://discuss.elastic.co/t/match-query-with-input-word-order-maintain/192677>\
**Category:** Elasticsearch\
**Created:** [July 29, 2019, 10:39am UTC](https://discuss.elastic.co/t/match-query-with-input-word-order-maintain/192677 "2019-07-29T10:39:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![harkesh\_kumar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/harkesh_kumar/32/51126_2.png) [@harkesh\_kumar](https://discuss.elastic.co/u/harkesh_kumar)\
**Post date:** [July 29, 2019, 10:39am UTC](https://discuss.elastic.co/t/match-query-with-input-word-order-maintain/192677/1 "2019-07-29T10:39:53Z")

</div>

0

I am working or Elastic search 7

I am facing some issue with Match query with elastic search My Issue i want to search all Possible result we match with sequence of words

_ **Like below Example:-** _

Input is - Pawan Shriman & Anr. Status Projects Pvt. Ltd.

_ **Found reasult are** _

1. Status Projects Private Limited
2. Amp Pipelines Projects Private Limited
3. Pawan Projects Pvt. Ltd
4. Anr Estates & Infracon Projects Private Limited
5. Pawan Putra Projects Private Limited
6. Anr Avenues And Turnkey Projects Private Limited
7. Shriman Nidhi Limited
8. Shriman Garments Private Limited

_ **Expect Result should be like** _

Pawan Shriman & Anr. Status Projects Pvt. Ltd.-\> Status Projects Private Limited Becuse sequence of latter same

_ **but in** _

Pawan Shriman & Anr. Status Projects Pvt. Ltd. In Other There are no Sequance So i will get only First Result not others

_ **Input Query** _

```auto
POST company_name_syno/_search
{
  "query": {
    "bool": {
      "should": [
        {
          "match": {
            "companyName": "Pawan Shriman &amp; Anr. Status Projects Pvt. Ltd."
          }
        }
      ]
    }
  }
}

```

_ **AND Output is am Getting Now** _

```auto
{
  "took" : 42,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : {
      "value" : 10000,
      "relation" : "gte"
    },
    "max_score" : 18.583344,
    "hits" : [
      {
        "_index" : "company_name_syno",
        "_type" : "_doc",
        "_id" : "621472",
        "_score" : 18.583344,
        "_source" : {
          "id" : 621472,
          "cin" : "U45200MP2011PTC025837",
          "companyName" : "Status Projects Private Limited"
        }
      },
      {
        "_index" : "company_name_syno",
        "_type" : "_doc",
        "_id" : "1583937",
        "_score" : 18.395374,
        "_source" : {
          "id" : 1583937,
          "cin" : "U70109DL2016PTC305994",
          "companyName" : "Amp Pipelines Projects Private Limited"
        }
      },
      {
        "_index" : "company_name_syno",
        "_type" : "_doc",
        "_id" : "710334",
        "_score" : 17.386831,
        "_source" : {
          "id" : 710334,
          "cin" : "U70109WB1995PTC067037",
          "companyName" : "Pawan Projects Pvt. Ltd."
        }
      },
      {
        "_index" : "company_name_syno",
        "_type" : "_doc",
        "_id" : "366006",
        "_score" : 17.138266,
        "_source" : {
          "id" : 366006,
          "cin" : "U70100AP2012PTC081254",
          "companyName" : "Anr Estates & Infracon Projects Private Limited"
        }
      },
      {
        "_index" : "company_name_syno",
        "_type" : "_doc",
        "_id" : "1140986",
        "_score" : 16.372063,
        "_source" : {
          "id" : 1140986,
          "cin" : "U70109DL2008PTC172275",
          "companyName" : "Pawan Putra Projects Private Limited"
        }
      },
      {
        "_index" : "company_name_syno",
        "_type" : "_doc",
        "_id" : "1435833",
        "_score" : 16.253246,
        "_source" : {
          "id" : 1435833,
          "cin" : "U45200TG2015PTC098051",
          "companyName" : "Anr Avenues And Turnkey Projects Private Limited"
        }
      },
      {
        "_index" : "company_name_syno",
        "_type" : "_doc",
        "_id" : "1586789",
        "_score" : 15.556036,
        "_source" : {
          "id" : 1586789,
          "cin" : "U65999BR2016PLC031924",
          "companyName" : "Shriman Nidhi Limited"
        }
      },
      {
        "_index" : "company_name_syno",
        "_type" : "_doc",
        "_id" : "66866",
        "_score" : 14.892519,
        "_source" : {
          "id" : 66866,
          "cin" : "U18101MH1973PTC016742",
          "companyName" : "Shriman Garments Private Limited"
        }
      },
      {
        "_index" : "company_name_syno",
        "_type" : "_doc",
        "_id" : "64254",
        "_score" : 14.892519,
        "_source" : {
          "id" : 64254,
          "cin" : "U17290PN2013PTC145934",
          "companyName" : "Shriman Texcom Private Limited"
        }
      },
      {
        "_index" : "company_name_syno",
        "_type" : "_doc",
        "_id" : "41488",
        "_score" : 14.892519,
        "_source" : {
          "id" : 41488,
          "cin" : "U15142RJ2003PTC018222",
          "companyName" : "Shriman Protiens Private Limited"
        }
      }
    ]
  }
}

```

---

<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 26, 2019, 10:39am UTC](https://discuss.elastic.co/t/match-query-with-input-word-order-maintain/192677/2 "2019-08-26T10:39:53Z")

</div>

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