# 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/8551>\
**Category:** Elasticsearch\
**Created:** [July 28, 2012, 9:03am UTC](https://discuss.elastic.co/t/searching-on-more-types-but-results-only-for-one-type-please-help/8551 "2012-07-28T09:03:08Z")\
**Posts on this page:** 13\
**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, 9:03am UTC](https://discuss.elastic.co/t/searching-on-more-types-but-results-only-for-one-type-please-help/8551/1 "2012-07-28T09:03:08Z")

</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!  
Rong

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 28, 2012, 9:12am UTC](https://discuss.elastic.co/t/searching-on-more-types-but-results-only-for-one-type-please-help/8551/2 "2012-07-28T09:12:02Z")

</div>

What happens if you do:

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

--

Le 28 juil. 2012 à 11:03, Rong Zhai [zhairong1975@googlemail.com](mailto:zhairong1975@googlemail.com) a écrit :

> 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\*" }  
> }  
> }

---

<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, 9:16am UTC](https://discuss.elastic.co/t/searching-on-more-types-but-results-only-for-one-type-please-help/8551/3 "2012-07-28T09:16:56Z")

</div>

I get still only result for one type: Building  
regards,  
Rong

On Saturday, July 28, 2012 11:12:02 AM UTC+2, David Pilato wrote:

> What happens if you do:
> 
> curl -XGET '[http://localhost:9200/pms/\_search?pretty=true](http://localhost:9200/pms/_search?pretty=true)'[http://localhost:9200/pms/Unit,Building/\_search?pretty=true'](http://localhost:9200/pms/Unit,Building/_search?pretty=true%27) -d  
> '{  
> "query" : {  
> "wildcard": { "street1" : "test\_street1\_11\*" }  
> }  
> }
> 
> --
> 
> Le 28 juil. 2012 à 11:03, Rong Zhai [zhairong1975@googlemail.com](mailto:zhairong1975@googlemail.com) a  
> écrit :
> 
> 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\*" }  
> }  
> }

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 28, 2012, 9:22am UTC](https://discuss.elastic.co/t/searching-on-more-types-but-results-only-for-one-type-please-help/8551/4 "2012-07-28T09:22:09Z")

</div>

That's strange.  
Can you gist a full curl recreation ?

BTW, which ES version are you using?

--

Le 28 juil. 2012 à 11:16, Rong Zhai [zhairong1975@googlemail.com](mailto:zhairong1975@googlemail.com) a écrit :

> I get still only result for one type: Building  
> regards,  
> Rong
> 
> On Saturday, July 28, 2012 11:12:02 AM UTC+2, David Pilato wrote:  
> What happens if you do:
> 
> curl -XGET '[http://localhost:9200/pms/\_search?pretty=true](http://localhost:9200/pms/_search?pretty=true)' -d '{  
> "query" : {  
> "wildcard": { "street1" : "test\_street1\_11\*" }  
> }  
> }
> 
> --
> 
> Le 28 juil. 2012 à 11:03, Rong Zhai [zhairong1975@googlemail.com](mailto:zhairong1975@googlemail.com) a écrit :
> 
> > 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\*" }  
> > }  
> > }

---

<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, 9:23am UTC](https://discuss.elastic.co/t/searching-on-more-types-but-results-only-for-one-type-please-help/8551/5 "2012-07-28T09:23:43Z")

</div>

what is a full curl recreation? I use es 0.19.4.  
regards,  
Rong

2012/7/28 David Pilato [david@pilato.fr](mailto:david@pilato.fr)

> That's strange.  
> Can you gist a full curl recreation ?
> 
> BTW, which ES version are you using?
> 
> --
> 
> Le 28 juil. 2012 à 11:16, Rong Zhai [zhairong1975@googlemail.com](mailto:zhairong1975@googlemail.com) a  
> écrit :
> 
> I get still only result for one type: Building  
> regards,  
> Rong
> 
> On Saturday, July 28, 2012 11:12:02 AM UTC+2, David Pilato wrote:
> 
> > What happens if you do:
> > 
> > curl -XGET '[http://localhost:9200/pms/\_\*\*search?pretty=true](http://localhost:9200/pms/_**search?pretty=true)'[http://localhost:9200/pms/Unit,Building/\_search?pretty=true'](http://localhost:9200/pms/Unit,Building/_search?pretty=true%27) -d  
> > '{  
> > "query" : {  
> > "wildcard": { "street1" : "test\_street1\_11\*" }  
> > }  
> > }
> > 
> > --
> > 
> > Le 28 juil. 2012 à 11:03, Rong Zhai [zhairong1975@googlemail.com](mailto:zhairong1975@googlemail.com) a  
> > écrit :
> > 
> > curl -XGET '[http://localhost:9200/pms/\*\*Unit,Building/\_search?pretty=](http://localhost:9200/pms/**Unit,Building/_search?pretty=)\*\*  
> > true' [http://localhost:9200/pms/Unit,Building/\_search?pretty=true'](http://localhost:9200/pms/Unit,Building/_search?pretty=true%27) -d  
> > '{  
> > "query" : {  
> > "wildcard": { "street1" : "test\_street1\_11\*" }  
> > }  
> > }

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 28, 2012, 9:25am UTC](https://discuss.elastic.co/t/searching-on-more-types-but-results-only-for-one-type-please-help/8551/6 "2012-07-28T09:25:32Z")

</div>

See [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/help/)

--

Le 28 juil. 2012 à 11:23, Rong Zhai [zhairong1975@googlemail.com](mailto:zhairong1975@googlemail.com) a écrit :

> what is a full curl recreation? I use es 0.19.4.  
> regards,  
> Rong
> 
> 2012/7/28 David Pilato [david@pilato.fr](mailto:david@pilato.fr)  
> That's strange.  
> Can you gist a full curl recreation ?
> 
> BTW, which ES version are you using?
> 
> --
> 
> Le 28 juil. 2012 à 11:16, Rong Zhai [zhairong1975@googlemail.com](mailto:zhairong1975@googlemail.com) a écrit :
> 
> > I get still only result for one type: Building  
> > regards,  
> > Rong
> > 
> > On Saturday, July 28, 2012 11:12:02 AM UTC+2, David Pilato wrote:  
> > What happens if you do:
> > 
> > curl -XGET '[http://localhost:9200/pms/\_search?pretty=true](http://localhost:9200/pms/_search?pretty=true)' -d '{  
> > "query" : {  
> > "wildcard": { "street1" : "test\_street1\_11\*" }  
> > }  
> > }
> > 
> > --
> > 
> > Le 28 juil. 2012 à 11:03, Rong Zhai [zhairong1975@googlemail.com](mailto:zhairong1975@googlemail.com) a écrit :
> > 
> > > 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\*" }  
> > > }  
> > > }

---

<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, 9:37am UTC](https://discuss.elastic.co/t/searching-on-more-types-but-results-only-for-one-type-please-help/8551/7 "2012-07-28T09:37:15Z")

</div>

Thanks, I get this:

curl -XGET '[http://127.0.0.1:9200/\_cluster/health?pretty=true](http://127.0.0.1:9200/_cluster/health?pretty=true)'  
{  
"cluster\_name" : "estatefusion",  
"status" : "yellow",  
"timed\_out" : false,  
"number\_of\_nodes" : 1,  
"number\_of\_data\_nodes" : 1,  
"active\_primary\_shards" : 5,  
"active\_shards" : 5,  
"relocating\_shards" : 0,  
"initializing\_shards" : 0,  
"unassigned\_shards" : 5  
}

Rong

2012/7/28 David Pilato [david@pilato.fr](mailto:david@pilato.fr)

> See [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/help/)
> 
> --
> 
> Le 28 juil. 2012 à 11:23, Rong Zhai [zhairong1975@googlemail.com](mailto:zhairong1975@googlemail.com) a  
> écrit :
> 
> what is a full curl recreation? I use es 0.19.4.  
> regards,  
> Rong
> 
> 2012/7/28 David Pilato [david@pilato.fr](mailto:david@pilato.fr)
> 
> > That's strange.  
> > Can you gist a full curl recreation ?
> > 
> > BTW, which ES version are you using?
> > 
> > --
> > 
> > Le 28 juil. 2012 à 11:16, Rong Zhai [zhairong1975@googlemail.com](mailto:zhairong1975@googlemail.com) a  
> > écrit :
> > 
> > I get still only result for one type: Building  
> > regards,  
> > Rong
> > 
> > On Saturday, July 28, 2012 11:12:02 AM UTC+2, David Pilato wrote:
> > 
> > > What happens if you do:
> > > 
> > > curl -XGET '[http://localhost:9200/pms/\_\*\*search?pretty=true](http://localhost:9200/pms/_**search?pretty=true)'[http://localhost:9200/pms/Unit,Building/\_search?pretty=true'](http://localhost:9200/pms/Unit,Building/_search?pretty=true%27) -d  
> > > '{  
> > > "query" : {  
> > > "wildcard": { "street1" : "test\_street1\_11\*" }  
> > > }  
> > > }
> > > 
> > > --
> > > 
> > > Le 28 juil. 2012 à 11:03, Rong Zhai [zhairong1975@googlemail.com](mailto:zhairong1975@googlemail.com) a  
> > > écrit :
> > > 
> > > curl -XGET '[http://localhost:9200/pms/\*\*Unit,Building/\_search?pretty=](http://localhost:9200/pms/**Unit,Building/_search?pretty=)\*\*  
> > > true' [http://localhost:9200/pms/Unit,Building/\_search?pretty=true'](http://localhost:9200/pms/Unit,Building/_search?pretty=true%27) -d  
> > > '{  
> > > "query" : {  
> > > "wildcard": { "street1" : "test\_street1\_11\*" }  
> > > }  
> > > }

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 28, 2012, 9:49am UTC](https://discuss.elastic.co/t/searching-on-more-types-but-results-only-for-one-type-please-help/8551/8 "2012-07-28T09:49:27Z")

</div>

You misunderstood.  
Create a gist : [gist.github.com](http://gist.github.com)  
Create a Shell script with curl commands:  
Delete index  
Create index  
Create doc1  
Create doc2  
Refresh type1,type2  
Search

This way, I can download the test case and run it on my side.

David

--

Le 28 juil. 2012 à 11:37, Rong Zhai [zhairong1975@googlemail.com](mailto:zhairong1975@googlemail.com) a écrit :

> Thanks, I get this:
> 
> curl -XGET '[http://127.0.0.1:9200/\_cluster/health?pretty=true](http://127.0.0.1:9200/_cluster/health?pretty=true)'  
> {  
> "cluster\_name" : "estatefusion",  
> "status" : "yellow",  
> "timed\_out" : false,  
> "number\_of\_nodes" : 1,  
> "number\_of\_data\_nodes" : 1,  
> "active\_primary\_shards" : 5,  
> "active\_shards" : 5,  
> "relocating\_shards" : 0,  
> "initializing\_shards" : 0,  
> "unassigned\_shards" : 5  
> }
> 
> Rong
> 
> 2012/7/28 David Pilato [david@pilato.fr](mailto:david@pilato.fr)  
> See [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/help/)
> 
> --
> 
> Le 28 juil. 2012 à 11:23, Rong Zhai [zhairong1975@googlemail.com](mailto:zhairong1975@googlemail.com) a écrit :
> 
> > what is a full curl recreation? I use es 0.19.4.  
> > regards,  
> > Rong
> > 
> > 2012/7/28 David Pilato [david@pilato.fr](mailto:david@pilato.fr)  
> > That's strange.  
> > Can you gist a full curl recreation ?
> > 
> > BTW, which ES version are you using?
> > 
> > --
> > 
> > Le 28 juil. 2012 à 11:16, Rong Zhai [zhairong1975@googlemail.com](mailto:zhairong1975@googlemail.com) a écrit :
> > 
> > > I get still only result for one type: Building  
> > > regards,  
> > > Rong
> > > 
> > > On Saturday, July 28, 2012 11:12:02 AM UTC+2, David Pilato wrote:  
> > > What happens if you do:
> > > 
> > > curl -XGET '[http://localhost:9200/pms/\_search?pretty=true](http://localhost:9200/pms/_search?pretty=true)' -d '{  
> > > "query" : {  
> > > "wildcard": { "street1" : "test\_street1\_11\*" }  
> > > }  
> > > }
> > > 
> > > --
> > > 
> > > Le 28 juil. 2012 à 11:03, Rong Zhai [zhairong1975@googlemail.com](mailto:zhairong1975@googlemail.com) a écrit :
> > > 
> > > > 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\*" }  
> > > > }  
> > > > }

---

<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, 9:50am UTC](https://discuss.elastic.co/t/searching-on-more-types-but-results-only-for-one-type-please-help/8551/9 "2012-07-28T09:50:23Z")

</div>

i am doing this, just 2 minutes.  
rong

2012/7/28 David Pilato [david@pilato.fr](mailto:david@pilato.fr)

> You misunderstood.  
> Create a gist : [gist.github.com](http://gist.github.com)  
> Create a Shell script with curl commands:  
> Delete index  
> Create index  
> Create doc1  
> Create doc2  
> Refresh type1,type2  
> Search
> 
> This way, I can download the test case and run it on my side.
> 
> David
> 
> --
> 
> Le 28 juil. 2012 à 11:37, Rong Zhai [zhairong1975@googlemail.com](mailto:zhairong1975@googlemail.com) a  
> écrit :
> 
> Thanks, I get this:
> 
> curl -XGET '[http://127.0.0.1:9200/\_cluster/health?pretty=true](http://127.0.0.1:9200/_cluster/health?pretty=true)'  
> {  
> "cluster\_name" : "estatefusion",  
> "status" : "yellow",  
> "timed\_out" : false,  
> "number\_of\_nodes" : 1,  
> "number\_of\_data\_nodes" : 1,  
> "active\_primary\_shards" : 5,  
> "active\_shards" : 5,  
> "relocating\_shards" : 0,  
> "initializing\_shards" : 0,  
> "unassigned\_shards" : 5  
> }
> 
> Rong
> 
> 2012/7/28 David Pilato [david@pilato.fr](mailto:david@pilato.fr)
> 
> > See [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/help/)
> > 
> > --
> > 
> > Le 28 juil. 2012 à 11:23, Rong Zhai [zhairong1975@googlemail.com](mailto:zhairong1975@googlemail.com) a  
> > écrit :
> > 
> > what is a full curl recreation? I use es 0.19.4.  
> > regards,  
> > Rong
> > 
> > 2012/7/28 David Pilato [david@pilato.fr](mailto:david@pilato.fr)
> > 
> > > That's strange.  
> > > Can you gist a full curl recreation ?
> > > 
> > > BTW, which ES version are you using?
> > > 
> > > --
> > > 
> > > Le 28 juil. 2012 à 11:16, Rong Zhai [zhairong1975@googlemail.com](mailto:zhairong1975@googlemail.com) a  
> > > écrit :
> > > 
> > > I get still only result for one type: Building  
> > > regards,  
> > > Rong
> > > 
> > > On Saturday, July 28, 2012 11:12:02 AM UTC+2, David Pilato wrote:
> > > 
> > > > What happens if you do:
> > > > 
> > > > curl -XGET '[http://localhost:9200/pms/\_\*\*search?pretty=true](http://localhost:9200/pms/_**search?pretty=true)'[http://localhost:9200/pms/Unit,Building/\_search?pretty=true'](http://localhost:9200/pms/Unit,Building/_search?pretty=true%27) -d  
> > > > '{  
> > > > "query" : {  
> > > > "wildcard": { "street1" : "test\_street1\_11\*" }  
> > > > }  
> > > > }
> > > > 
> > > > --
> > > > 
> > > > Le 28 juil. 2012 à 11:03, Rong Zhai [zhairong1975@googlemail.com](mailto:zhairong1975@googlemail.com) a  
> > > > écrit :
> > > > 
> > > > curl -XGET '[http://localhost:9200/pms/\*\*Unit,Building/\_search?pretty=](http://localhost:9200/pms/**Unit,Building/_search?pretty=)\*\*  
> > > > true' [http://localhost:9200/pms/Unit,Building/\_search?pretty=true'](http://localhost:9200/pms/Unit,Building/_search?pretty=true%27) -d  
> > > > '{  
> > > > "query" : {  
> > > > "wildcard": { "street1" : "test\_street1\_11\*" }  
> > > > }  
> > > > }

---

<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, 10:04am UTC](https://discuss.elastic.co/t/searching-on-more-types-but-results-only-for-one-type-please-help/8551/10 "2012-07-28T10:04:36Z")

</div>

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

you can create the index and search with one type or more types.

regards,  
Rong

2012/7/28 Rong Zhai [zhairong1975@googlemail.com](mailto:zhairong1975@googlemail.com)

> i am doing this, just 2 minutes.  
> rong
> 
> 2012/7/28 David Pilato [david@pilato.fr](mailto:david@pilato.fr)
> 
> > You misunderstood.  
> > Create a gist : [gist.github.com](http://gist.github.com)  
> > Create a Shell script with curl commands:  
> > Delete index  
> > Create index  
> > Create doc1  
> > Create doc2  
> > Refresh type1,type2  
> > Search
> > 
> > This way, I can download the test case and run it on my side.
> > 
> > David
> > 
> > --
> > 
> > Le 28 juil. 2012 à 11:37, Rong Zhai [zhairong1975@googlemail.com](mailto:zhairong1975@googlemail.com) a  
> > écrit :
> > 
> > Thanks, I get this:
> > 
> > curl -XGET '[http://127.0.0.1:9200/\_cluster/health?pretty=true](http://127.0.0.1:9200/_cluster/health?pretty=true)'  
> > {  
> > "cluster\_name" : "estatefusion",  
> > "status" : "yellow",  
> > "timed\_out" : false,  
> > "number\_of\_nodes" : 1,  
> > "number\_of\_data\_nodes" : 1,  
> > "active\_primary\_shards" : 5,  
> > "active\_shards" : 5,  
> > "relocating\_shards" : 0,  
> > "initializing\_shards" : 0,  
> > "unassigned\_shards" : 5  
> > }
> > 
> > Rong
> > 
> > 2012/7/28 David Pilato [david@pilato.fr](mailto:david@pilato.fr)
> > 
> > > See [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/help/)
> > > 
> > > --
> > > 
> > > Le 28 juil. 2012 à 11:23, Rong Zhai [zhairong1975@googlemail.com](mailto:zhairong1975@googlemail.com) a  
> > > écrit :
> > > 
> > > what is a full curl recreation? I use es 0.19.4.  
> > > regards,  
> > > Rong
> > > 
> > > 2012/7/28 David Pilato [david@pilato.fr](mailto:david@pilato.fr)
> > > 
> > > > That's strange.  
> > > > Can you gist a full curl recreation ?
> > > > 
> > > > BTW, which ES version are you using?
> > > > 
> > > > --
> > > > 
> > > > Le 28 juil. 2012 à 11:16, Rong Zhai [zhairong1975@googlemail.com](mailto:zhairong1975@googlemail.com) a  
> > > > écrit :
> > > > 
> > > > I get still only result for one type: Building  
> > > > regards,  
> > > > Rong
> > > > 
> > > > On Saturday, July 28, 2012 11:12:02 AM UTC+2, David Pilato wrote:
> > > > 
> > > > > What happens if you do:
> > > > > 
> > > > > curl -XGET '[http://localhost:9200/pms/\_\*\*search?pretty=true](http://localhost:9200/pms/_**search?pretty=true)'[http://localhost:9200/pms/Unit,Building/\_search?pretty=true'](http://localhost:9200/pms/Unit,Building/_search?pretty=true%27) -d  
> > > > > '{  
> > > > > "query" : {  
> > > > > "wildcard": { "street1" : "test\_street1\_11\*" }  
> > > > > }  
> > > > > }
> > > > > 
> > > > > --
> > > > > 
> > > > > Le 28 juil. 2012 à 11:03, Rong Zhai [zhairong1975@googlemail.com](mailto:zhairong1975@googlemail.com) a  
> > > > > écrit :
> > > > > 
> > > > > curl -XGET '[http://localhost:9200/pms/\*\*Unit,Building/\_search?pretty=](http://localhost:9200/pms/**Unit,Building/_search?pretty=)\*  
> > > > > _true'[http://localhost:9200/pms/Unit,Building/\_search?pretty=true'](http://localhost:9200/pms/Unit,Building/_search?pretty=true%27) -d  
> > > > > '{  
> > > > > "query" : {  
> > > > > "wildcard": { "street1" : "test\_street1\_11_" }  
> > > > > }  
> > > > > }

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 28, 2012, 10:40am UTC](https://discuss.elastic.co/t/searching-on-more-types-but-results-only-for-one-type-please-help/8551/11 "2012-07-28T10:40:44Z")

</div>

I see.

I updated the gist here : [https://gist.github.com/3192819](https://gist.github.com/3192819)

> <https://gist.github.com/dadoonet/3192819>

Problem was that in Building type, street1 is under address  
(address.street1)

In Unit type, street1 is under building.address. (building.address.street1)

In the gist I sent, I just added a building level on Building type and it  
works.

I cannot say if its an issue or not.

I suppose that Elasticsearch find a first document that match on  
building.address.street1 level and try to find if other documents match on  
this field but with no success.

HTH

David.

De : [elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com) [[mailto:elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com)]  
De la part de Rong Zhai  
Envoyé : samedi 28 juillet 2012 12:05  
À : [elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com)  
Objet : Re: searching on more types but results only for one type, please  
help!

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

  
you can create the index and search with one type or more types.

regards,  
Rong

2012/7/28 Rong Zhai [zhairong1975@googlemail.com](mailto:zhairong1975@googlemail.com)

i am doing this, just 2 minutes.  
rong

2012/7/28 David Pilato [david@pilato.fr](mailto:david@pilato.fr)

You misunderstood.

Create a gist : [gist.github.com](http://gist.github.com)

Create a Shell script with curl commands:

Delete index

Create index

Create doc1

Create doc2

Refresh type1,type2

Search

This way, I can download the test case and run it on my side.

David

--

Le 28 juil. 2012 à 11:37, Rong Zhai [zhairong1975@googlemail.com](mailto:zhairong1975@googlemail.com) a écrit :

Thanks, I get this:

curl -XGET '[http://127.0.0.1:9200/\_cluster/health?pretty=true](http://127.0.0.1:9200/_cluster/health?pretty=true)'  
{  
"cluster\_name" : "estatefusion",  
"status" : "yellow",  
"timed\_out" : false,  
"number\_of\_nodes" : 1,  
"number\_of\_data\_nodes" : 1,  
"active\_primary\_shards" : 5,  
"active\_shards" : 5,  
"relocating\_shards" : 0,  
"initializing\_shards" : 0,  
"unassigned\_shards" : 5  
}

Rong

2012/7/28 David Pilato [david@pilato.fr](mailto:david@pilato.fr)

See [http://www.elasticsearch.org/help/](http://www.elasticsearch.org/help/)

--

Le 28 juil. 2012 à 11:23, Rong Zhai [zhairong1975@googlemail.com](mailto:zhairong1975@googlemail.com) a écrit :

what is a full curl recreation? I use es 0.19.4.  
regards,  
Rong

2012/7/28 David Pilato [david@pilato.fr](mailto:david@pilato.fr)

That's strange.

Can you gist a full curl recreation ?

BTW, which ES version are you using?

--

Le 28 juil. 2012 à 11:16, Rong Zhai [zhairong1975@googlemail.com](mailto:zhairong1975@googlemail.com) a écrit :

I get still only result for one type: Building  
regards,  
Rong

On Saturday, July 28, 2012 11:12:02 AM UTC+2, David Pilato wrote:

What happens if you do:

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

--

Le 28 juil. 2012 à 11:03, Rong Zhai [zhairong1975@googlemail.com](mailto:zhairong1975@googlemail.com) a écrit :

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

---

<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, 2:30pm UTC](https://discuss.elastic.co/t/searching-on-more-types-but-results-only-for-one-type-please-help/8551/12 "2012-07-28T14:30:03Z")

</div>

I think it's a issue, the nested objects have its own architecture,  
actuelly I can not add building to type building, because it's already  
under Building. We have 3 Tables Unit, Building, and Address, Unit contents  
Building, Building contains Address, we want search with address and get  
two lists: building and unit.

but anyway, thank you for your support, if the problem can be fixed, please  
notice me, thank you.

regards,  
Rong

2012/7/28 David Pilato [david@pilato.fr](mailto:david@pilato.fr)

> I see.\*\*\*\*
> 
> * * *
> 
> I updated the gist here : [searching on more types but results only for one type, please help! · GitHub](https://gist.github.com/3192819)\*\*\*\*
> 
> * * *
> 
> Problem was that in Building type, street1 is under address  
> (address.street1)\*\*\*\*
> 
> In Unit type, street1 is under building.address. (building.address.street1)
> 
> * * *
> 
> * * *
> 
> In the gist I sent, I just added a building level on Building type and it  
> works.\*\*\*\*
> 
> * * *
> 
> * * *
> 
> I cannot say if it’s an issue or not.\*\*\*\*
> 
> I suppose that Elasticsearch find a first document that match on  
> building.address.street1 level and try to find if other documents match on  
> this field but with no success.\*\*\*\*
> 
> * * *
> 
> * * *
> 
> HTH\*\*\*\*
> 
> David.\*\*\*\*
> 
> * * *
> 
> * * *
> 
> _De :_ [elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com) [mailto:  
> [elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com)] _De la part de_ Rong Zhai  
> _Envoyé :_ samedi 28 juillet 2012 12:05  
> _À :_ [elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com)  
> _Objet :_ Re: searching on more types but results only for one type,  
> please help!\*\*\*\*
> 
> * * *
> 
> [searching on more types but results only for one type, please help! · GitHub](https://gist.github.com/3192732)  
> you can create the index and search with one type or more types.
> 
> regards,  
> Rong\*\*\*\*
> 
> 2012/7/28 Rong Zhai [zhairong1975@googlemail.com](mailto:zhairong1975@googlemail.com)\*\*\*\*
> 
> i am doing this, just 2 minutes.  
> rong\*\*\*\*
> 
> * * *
> 
> 2012/7/28 David Pilato [david@pilato.fr](mailto:david@pilato.fr)\*\*\*\*
> 
> You misunderstood.\*\*\*\*
> 
> Create a gist : [gist.github.com](http://gist.github.com) \*\*\*\*
> 
> Create a Shell script with curl commands:\*\*\*\*
> 
> Delete index\*\*\*\*
> 
> Create index\*\*\*\*
> 
> Create doc1\*\*\*\*
> 
> Create doc2\*\*\*\*
> 
> Refresh type1,type2\*\*\*\*
> 
> Search \*\*\*\*
> 
> * * *
> 
> This way, I can download the test case and run it on my side.\*\*\*\*
> 
> * * *
> 
> David\*\*\*\*
> 
> --\*\*\*\*
> 
> * * *
> 
> Le 28 juil. 2012 à 11:37, Rong Zhai [zhairong1975@googlemail.com](mailto:zhairong1975@googlemail.com) a  
> écrit :\*\*\*\*
> 
> Thanks, I get this:
> 
> curl -XGET '[http://127.0.0.1:9200/\_cluster/health?pretty=true](http://127.0.0.1:9200/_cluster/health?pretty=true)'  
> {  
> "cluster\_name" : "estatefusion",  
> "status" : "yellow",  
> "timed\_out" : false,  
> "number\_of\_nodes" : 1,  
> "number\_of\_data\_nodes" : 1,  
> "active\_primary\_shards" : 5,  
> "active\_shards" : 5,  
> "relocating\_shards" : 0,  
> "initializing\_shards" : 0,  
> "unassigned\_shards" : 5  
> }
> 
> Rong
> 
> * * *
> 
> 2012/7/28 David Pilato [david@pilato.fr](mailto:david@pilato.fr)\*\*\*\*
> 
> See [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/help/)\*\*\*\*
> 
> --\*\*\*\*
> 
> * * *
> 
> Le 28 juil. 2012 à 11:23, Rong Zhai [zhairong1975@googlemail.com](mailto:zhairong1975@googlemail.com) a  
> écrit :\*\*\*\*
> 
> what is a full curl recreation? I use es 0.19.4.  
> regards,  
> Rong\*\*\*\*
> 
> 2012/7/28 David Pilato [david@pilato.fr](mailto:david@pilato.fr)\*\*\*\*
> 
> That's strange.\*\*\*\*
> 
> Can you gist a full curl recreation ?\*\*\*\*
> 
> * * *
> 
> BTW, which ES version are you using?\*\*\*\*
> 
> --\*\*\*\*
> 
> * * *
> 
> Le 28 juil. 2012 à 11:16, Rong Zhai [zhairong1975@googlemail.com](mailto:zhairong1975@googlemail.com) a  
> écrit :\*\*\*\*
> 
> I get still only result for one type: Building  
> regards,  
> Rong
> 
> On Saturday, July 28, 2012 11:12:02 AM UTC+2, David Pilato wrote:\*\*\*\*
> 
> What happens if you do:\*\*\*\*
> 
> * * *
> 
> curl -XGET '[http://localhost:9200/pms/\_search?pretty=true](http://localhost:9200/pms/_search?pretty=true)'[http://localhost:9200/pms/Unit,Building/\_search?pretty=true'](http://localhost:9200/pms/Unit,Building/_search?pretty=true%27) -d  
> '{  
> "query" : {  
> "wildcard": { "street1" : "test\_street1\_11\*" }  
> }  
> } \*\*\*\*
> 
> * * *
> 
> --\*\*\*\*
> 
> * * *
> 
> Le 28 juil. 2012 à 11:03, Rong Zhai [zhairong1975@googlemail.com](mailto:zhairong1975@googlemail.com) a  
> écrit :\*\*\*\*
> 
> 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\*" }  
> }  
> } \*\*\*\*
> 
> * * *
> 
> * * *
> 
> * * *
> 
> * * *

---

<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/8551/13 "2017-07-06T03:18:37Z")

</div>


