# Query\_string not working as expected for multiple fields with AND as default\_operator

**URL:** <https://discuss.elastic.co/t/query-string-not-working-as-expected-for-multiple-fields-with-and-as-default-operator/261128>\
**Category:** Elasticsearch\
**Created:** [January 14, 2021, 1:51pm UTC](https://discuss.elastic.co/t/query-string-not-working-as-expected-for-multiple-fields-with-and-as-default-operator/261128 "2021-01-14T13:51:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![san87singh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/san87singh/32/76864_2.png) [@san87singh](https://discuss.elastic.co/u/san87singh)\
**Post date:** [January 14, 2021, 1:51pm UTC](https://discuss.elastic.co/t/query-string-not-working-as-expected-for-multiple-fields-with-and-as-default-operator/261128/1 "2021-01-14T13:51:13Z")

</div>

We are not able to get match for a query on multiple fields using query\_string. We are not sure why it is not working even if it's a simple query. Below is the query, document and mapping (index) that we are using:  
**Query:**  
{​  
"query": {​  
"query\_string": {  
​ "query": "Paliperidone palmitate for cochrane nussbaum",  
"default\_operator": "AND",  
"type": "most\_fields",  
"fields": ["title", "authors","body"]  
}  
}  
}​  
**Document:**  
{  
"title" : "Paliperidone palmitate for schizophrenia.",  
"body" : "Paliperidone palmitate, long-acting, intramuscular formulation paliperidone, is now available clinical use. Paliperidone is active metabolite risperidone is also available oral formulation daily use.. compare effects paliperidone palmitate any other treatment people schizophrenia schizophrenia-like illnesses.. We searched Cochrane Schizophrenia Group's Register (November 2009) inspected references identified studies further trials.",  
"authors" : [  
"Abraham M Nussbaum",  
"T S Stroup"  
]  
}  
**Mappings:**  
{  
"settings": {  
"analysis": {  
"filter": {  
"english\_stop": {  
"type": "stop",  
"stopwords": "_english_"  
},  
"test\_keyword\_marker\_filter": {  
"type": "keyword\_marker",  
"keywords\_pattern": "NLM\*",  
"ignore\_case": true  
},  
"lowercase\_filter": {  
"type": "lowercase"  
}  
},  
"analyzer": {  
"test\_standard\_analyzer": {  
"tokenizer": "standard",  
"filter": [  
"english\_stop",  
"test\_keyword\_marker\_filter",  
"lowercase\_filter"  
]  
}  
}  
}  
},  
"mappings": {  
"properties": {  
"authors": {  
"type": "text",  
"fields": {  
"keyword": {  
"type": "keyword",  
"ignore\_above": 256  
}  
},  
"analyzer": "test\_standard\_analyzer"  
},  
"body": {  
"type": "text",  
"fields": {  
"keyword": {  
"type": "keyword",  
"ignore\_above": 256  
}  
},  
"analyzer": "test\_standard\_analyzer"  
},  
"title": {  
"type": "text",  
"fields": {  
"keyword": {  
"type": "keyword",  
"ignore\_above": 256  
}  
},  
"analyzer": "test\_standard\_analyzer"  
}  
}  
}  
}

---

<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:** [February 11, 2021, 1:51pm UTC](https://discuss.elastic.co/t/query-string-not-working-as-expected-for-multiple-fields-with-and-as-default-operator/261128/2 "2021-02-11T13:51:20Z")

</div>

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