# Searching on more types but results only for one type, please help!

**URL:** <https://discuss.elastic.co/t/searching-on-more-types-but-results-only-for-one-type-please-help/8550>\
**Category:** Elasticsearch\
**Created:** [July 28, 2012, 8:18am UTC](https://discuss.elastic.co/t/searching-on-more-types-but-results-only-for-one-type-please-help/8550 "2012-07-28T08:18:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zhairong](https://avatars.discourse-cdn.com/v4/letter/z/c2a13f/32.png) [@zhairong](https://discuss.elastic.co/u/zhairong)\
**Post date:** [July 28, 2012, 8:18am UTC](https://discuss.elastic.co/t/searching-on-more-types-but-results-only-for-one-type-please-help/8550/1 "2012-07-28T08:18:36Z")

</div>

dear all,  
I have the following case:  
index: pms  
type: Unit, Building

searching with one type:  
curl -XGET '[http://localhost:9200/pms/Building/\_search?pretty=true](http://localhost:9200/pms/Building/_search?pretty=true)' -d '{  
"query" : {  
"wildcard": { "street1" : "test\_street1\_11\*" }  
}  
}  
'  
I get the response:  
{  
"took" : 5,  
"timed\_out" : false,  
"\_shards" : {  
"total" : 5,  
"successful" : 5,  
"failed" : 0  
},  
"hits" : {  
"total" : 1,  
"max\_score" : 1.0,  
"hits" : [ {  
"\_index" : "pms",  
"\_type" : "Building",  
"\_id" : "11",  
"\_score" : 1.0, "_source" : {"id":11,"address":{"street2":"test\_street2\_11","region":"test\_region\_11","id":11,"street1":"test\_street1\_11","postalCode":"40349","country":{"id":1,"isoName":"test_"},"city":"test\_city\_11"},"buildingType":"TYPE3","units":3}  
} ]  
}  
}

searching with unit:

curl -XGET '[http://localhost:9200/pms/Unit/\_search?pretty=true](http://localhost:9200/pms/Unit/_search?pretty=true)' -d '{  
"query" : {  
"wildcard": { "street1" : "test\_street1\_11\*" }  
}  
}  
I get response:  
{  
"took" : 4,  
"timed\_out" : false,  
"\_shards" : {  
"total" : 5,  
"successful" : 5,  
"failed" : 0  
},  
"hits" : {  
"total" : 1,  
"max\_score" : 1.0,  
"hits" : [ {  
"\_index" : "pms",  
"\_type" : "Unit",  
"\_id" : "53",  
"\_score" : 1.0, "_source" : {"id":53,"building":{"id":1128,"address":{"street2":"test\_street2\_1128","region":"test\_region\_1128","id":1128,"street1":"test\_street1\_1128","postalCode":"51035","country":{"id":2,"isoName":"test_"},"city":"test\_city\_1128"},"buildingType":"OLD","units":7},"numberRooms":7,"unitType":"TYPE3","unitNumber":"62","floorNumber":7,"ownershipShare":4}  
} ]  
}  
}

so I think, if I search with 2 types unit and building, I should get 2 result:

curl -XGET '[http://localhost:9200/pms/Unit,Building/\_search?pretty=true](http://localhost:9200/pms/Unit,Building/_search?pretty=true)' -d '{  
"query" : {  
"wildcard": { "street1" : "test\_street1\_11\*" }  
}  
}

But I get only one, if types is Unit,Building, I get result only for Unit, if type are Building,Unit, I get result only for Building.

But I want result for buiding and unit.

please help, thanks!

---

<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:18am UTC](https://discuss.elastic.co/t/searching-on-more-types-but-results-only-for-one-type-please-help/8550/2 "2017-07-06T03:18:41Z")

</div>


