# Set default\_operator to AND, except in field queries

**URL:** <https://discuss.elastic.co/t/set-default-operator-to-and-except-in-field-queries/15356>\
**Category:** Elasticsearch\
**Created:** [January 22, 2014, 11:24am UTC](https://discuss.elastic.co/t/set-default-operator-to-and-except-in-field-queries/15356 "2014-01-22T11:24:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nicolas\_Fouche](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nicolas_fouche/32/1849_2.png) [@Nicolas\_Fouche](https://discuss.elastic.co/u/Nicolas_Fouche)\
**Post date:** [January 22, 2014, 11:24am UTC](https://discuss.elastic.co/t/set-default-operator-to-and-except-in-field-queries/15356/1 "2014-01-22T11:24:13Z")

</div>

Hi,

I wonder if I can set the default operator to AND, except in field queries.

The goal is for the user to write something like: "roger moore  
tags:(marketing twitter)", and it would be translated to "roger AND moore  
AND tags:(marketing OR twitter)".

I know I can do it with term filters. "roger moore" would be the query  
string and the tags would be in term filters.

But in my app, I need the user to be able to type the query in a text  
field, and I wonder if I really have to make a parser to translate the user  
queries, or there is an option to support this in ElasticSearch.

Thanks,  
Nicolas

--  
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/d64c1df7-0fef-4614-940b-94b7c5b87654%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d64c1df7-0fef-4614-940b-94b7c5b87654%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:55am UTC](https://discuss.elastic.co/t/set-default-operator-to-and-except-in-field-queries/15356/2 "2017-07-06T01:55:24Z")

</div>


