# Searching over multiple untouched fields without "\_all"

**URL:** <https://discuss.elastic.co/t/searching-over-multiple-untouched-fields-without--all/14383>\
**Category:** Elasticsearch\
**Created:** [November 13, 2013, 2:18pm UTC](https://discuss.elastic.co/t/searching-over-multiple-untouched-fields-without--all/14383 "2013-11-13T14:18:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nd\_Coderific](https://avatars.discourse-cdn.com/v4/letter/n/7feea3/32.png) [@Nd\_Coderific](https://discuss.elastic.co/u/Nd_Coderific)\
**Post date:** [November 13, 2013, 2:18pm UTC](https://discuss.elastic.co/t/searching-over-multiple-untouched-fields-without--all/14383/1 "2013-11-13T14:18:07Z")

</div>

Hi there,

I´m new to Elasticsearch.

I tried to search over multiple untouched fields with the following query:

{  
"from" : searchPageNumberFTS,  
"size":10,  
"sort":{},  
"query":[ {  
"filtered" : {  
"query" : {  
"wildcard" :  
{ "Product.untouched":searchTextFulltextSearch}

} ,  
"filter": {  
"or":[  
{  
"query": {  
"wildcard": {  
"Test.untouched": "\*"  
}  
}  
}  
]  
}  
},"filtered" : {  
"query" : {  
"wildcard" :  
{ "Project.untouched":searchTextFulltextSearch}

} ,  
"filter": {  
"or":[  
{  
"query": {  
"wildcard": {  
"Test.untouched": "\*"  
}  
}  
}  
]  
}  
}  
}]  
};  
But the 1st query was overwritten! It resolves as :

1. {"from":0,"size":10,"sort":{},"query":[{"filtered":{"query":{  
"wildcard":{"Project.untouched":"_CRI\*\*1_"}},"filter":{"or":[{"query":{  
"wildcard":{"Test.untouched":"\*"}}}]}}}]}:

_is there any posiblility to search over more the one untouched field ?_

Greetings  
ND

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [November 13, 2013, 8:01pm UTC](https://discuss.elastic.co/t/searching-over-multiple-untouched-fields-without--all/14383/2 "2013-11-13T20:01:27Z")

</div>

You need to combine the different queries with a bool query instead of  
creating an array of queries:

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

Also, are you sure you want to use a query filter that is essentially a  
match all? Not sure what you heop to achieve, but perhaps the exist filter  
might be more appropriate:

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

Cheers,

Ivan

On Wed, Nov 13, 2013 at 6:18 AM, Nd Coderific  
[andreas.coder@googlemail.com](mailto:andreas.coder@googlemail.com)wrote:

> Hi there,
> 
> I´m new to Elasticsearch.
> 
> I tried to search over multiple untouched fields with the following query:
> 
> {  
> "from" : searchPageNumberFTS,  
> "size":10,  
> "sort":{},  
> "query":[ {  
> "filtered" : {  
> "query" : {  
> "wildcard" :  
> { "Product.untouched":searchTextFulltextSearch}
> 
> } ,  
> "filter": {  
> "or":[  
> {  
> "query": {  
> "wildcard": {  
> "Test.untouched": "\*"  
> }  
> }  
> }  
> ]  
> }  
> },"filtered" : {  
> "query" : {  
> "wildcard" :  
> { "Project.untouched":searchTextFulltextSearch}
> 
> } ,  
> "filter": {  
> "or":[  
> {  
> "query": {  
> "wildcard": {  
> "Test.untouched": "\*"  
> }  
> }  
> }  
> ]  
> }  
> }  
> }]  
> };  
> But the 1st query was overwritten! It resolves as :
> 
> 1. {"from":0,"size":10,"sort":{},"query":[{"filtered":{"query":{  
> "wildcard":{"Project.untouched":"_CRI\*\*1_"}},"filter":{"or":[{"query":{  
> "wildcard":{"Test.untouched":"\*"}}}]}}}]}:
> 
> _is there any posiblility to search over more the one untouched field ?_
> 
> Greetings  
> ND
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
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, 2:07am UTC](https://discuss.elastic.co/t/searching-over-multiple-untouched-fields-without--all/14383/3 "2017-07-06T02:07:24Z")

</div>


