# Querystring query doubt on multifield

**URL:** <https://discuss.elastic.co/t/querystring-query-doubt-on-multifield/17587>\
**Category:** Elasticsearch\
**Created:** [May 19, 2014, 11:34am UTC](https://discuss.elastic.co/t/querystring-query-doubt-on-multifield/17587 "2014-05-19T11:34:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cyrilforce](https://avatars.discourse-cdn.com/v4/letter/c/76d3ee/32.png) [@cyrilforce](https://discuss.elastic.co/u/cyrilforce)\
**Post date:** [May 19, 2014, 11:34am UTC](https://discuss.elastic.co/t/querystring-query-doubt-on-multifield/17587/1 "2014-05-19T11:34:05Z")

</div>

Hi,

I trying to form a query\_string query to query two fields as below :

_1)Query DISPLAY\_NAME field and PERFORMER field whether contain "we are  
one" :_  
{  
"explain" : true,  
"from" : 0,  
"size" : 10,

```
      "query" : {
        "query_string" : {
           "fields" : ["DISPLAY_NAME^6.0", "PERFORMER"],
          "query" : "\"we are one\"",            
          "use_dis_max" : true
        }
      }

```

}

Result returned one documents :

> <https://gist.github.com/cheehoo/c58be9ef2cc5f7a60f1e>

_2)Query DISPLAY\_NAME field whether contain "we are one" :_

{  
"explain" : true,  
"from" : 0,  
"size" : 10,

```
      "query" : {
        "query_string" : {
           "fields" : ["DISPLAY_NAME^6.0"],
          "query" : "\"we are one\"",         
          "use_dis_max" : true
        }
      }

```

}

Result returned 5 documents :

> <https://gist.github.com/cheehoo/e64f7c8ca7e7dc427fe5>

_3) The mapping :_

> <https://gist.github.com/cheehoo/f38a9ec3ce8ddcaaaaba>

\*4)The index settings : \*

> <https://gist.github.com/cheehoo/65ac6446a0bf5eee9495>

I wanted to know why it will returned different result because in the index  
5 documents contain \* "we are one"\* in the \*DISPLAY\_NAME \*field however  
the first query 1) returned one document only.  
How i could solve this problem ? Also noticed from the explain section  
seems like the boosting is not applied.

What i wanted to achieve here is when i search \*"we are one" \*it should  
return all the documents that \*DISPLAY\_NAME \*or \*PERFORMER \*contains the  
search text and sorted BY DISPLAY\_NAME then only PERFORMER.

eg :

1. DISPLAY\_NAME : _we are one_  
PERFORMER : _we are one_

2. DISPLAY\_NAME : _we are one_  
PERFORMER : Jaclyn

3. DISPLAY\_NAME : _we are one_ of the best  
PERFORMER : Victor

4. DISPLAY\_NAME : James  
PERFORMER : _we are one_

5. DISPLAY\_NAME : David  
PERFORMER : _we are one_ in the world

Thanks.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/2acdbee6-52e5-49ad-8491-efd9ed9617ea%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2acdbee6-52e5-49ad-8491-efd9ed9617ea%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:28am UTC](https://discuss.elastic.co/t/querystring-query-doubt-on-multifield/17587/2 "2017-07-06T01:28:32Z")

</div>


