Nested documents returned in search results by error


(Jennifer Cumming) #1

I'm trying to use a nested object type to store some additional data but
running into some inconsistencies versus the documentation when it comes to
searching. From the documentation it sounds like a simple search like

{
"query": {
"bool": {
"must" : {
"query_string": {
"query": "jane"
}
}
}
}
}

Should not return any documents where the only instance of "jane" is in a
nested document. Yet when I run this search against my test data it does.
Mystery deepens when I then use the explain API to try work out why it was
returned and it says the document was matched on _all yet I have
include_in_all set to false in the mapping.

mapping and data for the two documents
here https://gist.github.com/anonymous/febab9c09bdf9ea9849c
Search results here https://gist.github.com/anonymous/74311fab5e2452938505
Explain here https://gist.github.com/anonymous/4fed3653658d70fb0df8

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/4a2ab8e2-f725-4eb5-a4ee-1cb9d6a5097f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Jennifer Cumming) #2

Update to this. I installed the lastest version and this fixed my issue
for a while until I ran a search with a query with highlighting that should
not have hit on the nested documents but they appeared in the results.. At
this point I started to see the nested documents hitting on every query
(with or without highlighting) due to their contents now being included in
_all. It looks like doing the highlighting pulled everything into the _all
field.

On Thursday, 31 July 2014 11:12:23 UTC+1, Jennifer Cumming wrote:

I'm trying to use a nested object type to store some additional data but
running into some inconsistencies versus the documentation when it comes to
searching. From the documentation it sounds like a simple search like

{
"query": {
"bool": {
"must" : {
"query_string": {
"query": "jane"
}
}
}
}
}

Should not return any documents where the only instance of "jane" is in a
nested document. Yet when I run this search against my test data it does.
Mystery deepens when I then use the explain API to try work out why it was
returned and it says the document was matched on _all yet I have
include_in_all set to false in the mapping.

mapping and data for the two documents here
https://gist.github.com/anonymous/febab9c09bdf9ea9849c
Search results here https://gist.github.com/anonymous/74311fab5e2452938505
Explain here https://gist.github.com/anonymous/4fed3653658d70fb0df8

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/9e3c1f7a-af70-43ee-9415-585b898de54a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(system) #3