# Searching for "SOMETHING" in "SOMEWHERE"

**URL:** <https://discuss.elastic.co/t/searching-for-something-in-somewhere/172212>\
**Category:** Elasticsearch\
**Created:** [March 13, 2019, 7:31pm UTC](https://discuss.elastic.co/t/searching-for-something-in-somewhere/172212 "2019-03-13T19:31:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![RMNYC](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rmnyc/32/41785_2.png) [@RMNYC](https://discuss.elastic.co/u/RMNYC)\
**Post date:** [March 13, 2019, 7:31pm UTC](https://discuss.elastic.co/t/searching-for-something-in-somewhere/172212/1 "2019-03-13T19:31:44Z")

</div>

Here's a simplified example of what I'm trying to achieve - I am sure this is a pretty standard thing and I hope someone can point me in the right direction of a pattern, method, way to do this without re-inventing the wheel.

```
PUT /test/vendors/1
{
  "type": "clinic",
  "name": "ENT of Boston",
  "place": "Boston"  
}

PUT /test/vendors/2
{
  "type": "law firm",
  "name": "Ambulance Chasers Inc.",
  "place": "Boston"  

}

```

Say I want to support searches like these:

```
"Ambulance Chasers"
"Law Firm in Boston"

```

I can do a search like this:

```
GET /test/_search
{
  "query": {
    "multi_match" : {
      "query": "Law Firm in Boston", 
      "fields": ["type", "place", "name"],
      "type": "most_fields"
    }
  }
}

```

the thing is, this would also get me `ENT Of Boston` because it has `Boston` in its name, although that's clearly not what I'm looking for.

I know I can write my own code to analyze the search string before it's submitted to Elasticsearch, and force `Boston` to be searched only in the `place` field in documents. I can do that to all fields and issue a super pin-pointer search query for EXACTLY what the user needs. But is there an easier way to handle something like that which I am missing?

I guess what I'm asking is whether there's a way Elasticseaarch can allow me to fine tune and "understand" what I'm looking for, without forcing me to dive deep into Natural Language Processing in my own code and re-invent the wheel.

---

<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:** [April 10, 2019, 7:32pm UTC](https://discuss.elastic.co/t/searching-for-something-in-somewhere/172212/2 "2019-04-10T19:32:03Z")

</div>

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