# Searching with .\_all in multi\_field

**URL:** <https://discuss.elastic.co/t/searching-with--all-in-multi-field/7946>\
**Category:** Elasticsearch\
**Created:** [June 1, 2012, 9:04pm UTC](https://discuss.elastic.co/t/searching-with--all-in-multi-field/7946 "2012-06-01T21:04:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gert\_Jan\_van\_de\_Stre](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gert_jan_van_de_stre/32/2863_2.png) [@Gert\_Jan\_van\_de\_Stre](https://discuss.elastic.co/u/Gert_Jan_van_de_Stre)\
**Post date:** [June 1, 2012, 9:04pm UTC](https://discuss.elastic.co/t/searching-with--all-in-multi-field/7946/1 "2012-06-01T21:04:23Z")

</div>

I am searching with .\_all in a multi\_field and not getting results from the  
default. Below are 4 queries, where the first 3 yield results, but #4 does  
not. It looks like the default field is not part of \_all. Any thoughts?

(see this gist [https://gist.github.com/2855138](https://gist.github.com/2855138) for the complete setup)

curl -XGET  
'[http://localhost:9200/translations/translation/\_search?pretty=true](http://localhost:9200/translations/translation/_search?pretty=true)' -d '  
{  
"query" : {  
"text" : { "translation.untouched":  
"Hippopotomonstrosesquipedalian" }  
}  
}'

curl -XGET  
'[http://localhost:9200/translations/translation/\_search?pretty=true](http://localhost:9200/translations/translation/_search?pretty=true)' -d '  
{  
"query" : {  
"text" : { "translation.\_all": "Hippopotomonstrosesquipedalian" }  
}  
}'

curl -XGET  
'[http://localhost:9200/translations/translation/\_search?pretty=true](http://localhost:9200/translations/translation/_search?pretty=true)' -d '  
{  
"query" : {  
"text" : { "translation": "quip" }  
}  
}'

curl -XGET  
'[http://localhost:9200/translations/translation/\_search?pretty=true](http://localhost:9200/translations/translation/_search?pretty=true)' -d '  
{  
"query" : {  
"text" : { "translation\_all": "quip" }  
}  
}'

---

<div class="post-metadata">

**Author:** ![Gert\_Jan\_van\_de\_Stre](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gert_jan_van_de_stre/32/2863_2.png) [@Gert\_Jan\_van\_de\_Stre](https://discuss.elastic.co/u/Gert_Jan_van_de_Stre)\
**Post date:** [June 1, 2012, 9:25pm UTC](https://discuss.elastic.co/t/searching-with--all-in-multi-field/7946/2 "2012-06-01T21:25:50Z")

</div>

The last one is missing a dot, here's what I meant it to be:

curl -XGET '  
[http://localhost:9200/translations/translation/\_search?pretty=true](http://localhost:9200/translations/translation/_search?pretty=true)' -d '  
{  
"query" : {  
"text" : { "translation.\_all": "quip" }  
}  
}'

The problem is all the same though.

---

<div class="post-metadata">

**Author:** ![Mats\_Stijlaart](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mats_stijlaart/32/2868_2.png) [@Mats\_Stijlaart](https://discuss.elastic.co/u/Mats_Stijlaart)\
**Post date:** [June 4, 2012, 8:35am UTC](https://discuss.elastic.co/t/searching-with--all-in-multi-field/7946/3 "2012-06-04T08:35:57Z")

</div>

Hi Gert-Jan,

I tried to reproduce your problem (with success). I couldn't find the  
solution, but I have to say I think your assumption is incorrect.

I changed the default field in your 'multi field'. The incomplete became  
the default, and the default got an alias with the name 'ngram'.

This query gives a result:

"text" : { "translation.\_all": "Hippopotomonstrosesquipedalian" }

This query \*doesn't \*(but should have had a) match:

"text" : { "translation.\_all": "quip" }

With this setting, the default field is matched while using the \_all.

I think there is a problem with the combination of a '\_all' and a 'ngram'  
on a multi field.

Op vrijdag 1 juni 2012 23:04:23 UTC+2 schreef Gert-Jan van de Streek het  
volgende:

> I am searching with .\_all in a multi\_field and not getting results from  
> the default. Below are 4 queries, where the first 3 yield results, but #4  
> does not. It looks like the default field is not part of \_all. Any thoughts?
> 
> (see this gist [https://gist.github.com/2855138](https://gist.github.com/2855138) for the complete setup)
> 
> curl -XGET '  
> [http://localhost:9200/translations/translation/\_search?pretty=true](http://localhost:9200/translations/translation/_search?pretty=true)' -d '  
> {  
> "query" : {  
> "text" : { "translation.untouched":  
> "Hippopotomonstrosesquipedalian" }  
> }  
> }'
> 
> curl -XGET '  
> [http://localhost:9200/translations/translation/\_search?pretty=true](http://localhost:9200/translations/translation/_search?pretty=true)' -d '  
> {  
> "query" : {  
> "text" : { "translation.\_all": "Hippopotomonstrosesquipedalian" }  
> }  
> }'
> 
> curl -XGET '  
> [http://localhost:9200/translations/translation/\_search?pretty=true](http://localhost:9200/translations/translation/_search?pretty=true)' -d '  
> {  
> "query" : {  
> "text" : { "translation": "quip" }  
> }  
> }'
> 
> curl -XGET '  
> [http://localhost:9200/translations/translation/\_search?pretty=true](http://localhost:9200/translations/translation/_search?pretty=true)' -d '  
> {  
> "query" : {  
> "text" : { "translation\_all": "quip" }  
> }  
> }'

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [June 4, 2012, 1:44pm UTC](https://discuss.elastic.co/t/searching-with--all-in-multi-field/7946/4 "2012-06-04T13:44:02Z")

</div>

The first query is searching the field _translation.untouched_ for the word  
Hippopotomonstrosesquipedalian using _translation\_search\_analyzer_ analyzer  
The second query is searching the field\* \_all\* for the word  
Hippopotomonstrosesquipedalian using _standard_ analyzer  
The third query is searching the field _translation_ for the word quip  
using _translation\_search\_analyzer_ analyzer  
The forth query is searching the field _\_all_ for the word quip using \*  
standard\* analyzer

The standard analyzer doesn't split words into ngrams. That's why the last  
query doesn't return any results.

On Friday, June 1, 2012 5:25:50 PM UTC-4, Gert-Jan van de Streek wrote:

> The last one is missing a dot, here's what I meant it to be:
> 
> curl -XGET '  
> [http://localhost:9200/translations/translation/\_search?pretty=true](http://localhost:9200/translations/translation/_search?pretty=true)' -d '  
> {  
> "query" : {  
> "text" : { "translation.\_all": "quip" }  
> }  
> }'
> 
> The problem is all the same though.

---

<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:25am UTC](https://discuss.elastic.co/t/searching-with--all-in-multi-field/7946/5 "2017-07-06T03:25:43Z")

</div>


