Searching with ._all in multi_field


(Gert-Jan van de Streek) #1

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 for the complete setup)

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

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

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

curl -XGET
'http://localhost:9200/translations/translation/_search?pretty=true' -d '
{
"query" : {
"text" : { "translation_all": "quip" }
}
}'


(Gert-Jan van de Streek) #2

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' -d '
{
"query" : {
"text" : { "translation._all": "quip" }
}
}'

The problem is all the same though.


(Mats Stijlaart) #3

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 for the complete setup)

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

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

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

curl -XGET '
http://localhost:9200/translations/translation/_search?pretty=true' -d '
{
"query" : {
"text" : { "translation_all": "quip" }
}
}'


(Igor Motov) #4

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' -d '
{
"query" : {
"text" : { "translation._all": "quip" }
}
}'

The problem is all the same though.


(system) #5