# Query\_string field specific search with nGram tokenizer

**URL:** <https://discuss.elastic.co/t/query-string-field-specific-search-with-ngram-tokenizer/8946>\
**Category:** Elasticsearch\
**Created:** [September 6, 2012, 11:58am UTC](https://discuss.elastic.co/t/query-string-field-specific-search-with-ngram-tokenizer/8946 "2012-09-06T11:58:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Asif](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@Asif](https://discuss.elastic.co/u/Asif)\
**Post date:** [September 6, 2012, 11:58am UTC](https://discuss.elastic.co/t/query-string-field-specific-search-with-ngram-tokenizer/8946/1 "2012-09-06T11:58:06Z")

</div>

Hi all,  
I want to search different fields for different substrings.

```
 e.g:

  say my documents have field_1, field_2 and field_3. I want to search 

```

documents where field\_1 has "aa" field\_2 has "bb" and field\_3 has "cc".

```
   I know if I use nGram analyzer it is possible to search for "aa", 

```

"bb" and "cc" (using query\_string) and put them into a must clause would  
have worked; but, it does not take into account which match occurred in  
which field.

```
   I read somewhere that query_string: { "query":{ 

```

"field\_name":"string\_to\_match", field\_name2:"string\_to\_match2"}} does that;  
but, I don't see it working since I started using nGram analyzer.

Any help in this regard would be appreciated.

thanks  
Asif

--

---

<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:** [July 6, 2017, 3:13am UTC](https://discuss.elastic.co/t/query-string-field-specific-search-with-ngram-tokenizer/8946/2 "2017-07-06T03:13:56Z")

</div>


