# Issue with has\_parent query with score\_type "score"

**URL:** <https://discuss.elastic.co/t/issue-with-has-parent-query-with-score-type-score/12591>\
**Category:** Elasticsearch\
**Created:** [July 1, 2013, 2:00am UTC](https://discuss.elastic.co/t/issue-with-has-parent-query-with-score-type-score/12591 "2013-07-01T02:00:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nathan](https://avatars.discourse-cdn.com/v4/letter/n/c5a1d2/32.png) [@Nathan](https://discuss.elastic.co/u/Nathan)\
**Post date:** [July 1, 2013, 2:00am UTC](https://discuss.elastic.co/t/issue-with-has-parent-query-with-score-type-score/12591/1 "2013-07-01T02:00:06Z")

</div>

Hi,

I've come across an issue when attempting to query with has\_parent.  
Specifically it seems to be an issue when you have multiple child documents  
and add "score\_type": "score".

I've created a gist with a simple example using properties and people.

> <https://gist.github.com/anonymous/5897829>

123 Fake St  
-\> John Smith  
-\> Bob Jones  
-\> Rob Bardon

Querying for "John Smith" with a parent "123 Fake St" returns "John Smith"  
as expected.  
Querying for "Bob Jones" with a parent "123 Fake St" returns no results. If  
I remove the "score\_type" it returns "Bob Jones" as expected.

ES Version: 0.90.0 and 0.90.2

Java Version:  
java version "1.7.0\_11"  
Java(TM) SE Runtime Environment (build 1.7.0\_11-b21)  
Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)

Am I doing something wrong? Is there a better way to construct the query?  
In reality I'll have multiple search terms against a person's name (hence  
the min should match) as well as the address and I want to order by best  
match against both parent and child.

Cheers,  
Nathan

--  
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:28am UTC](https://discuss.elastic.co/t/issue-with-has-parent-query-with-score-type-score/12591/2 "2017-07-06T02:28:53Z")

</div>


