# No Type Request

**URL:** <https://discuss.elastic.co/t/no-type-request/4267>\
**Category:** Elasticsearch\
**Created:** [April 20, 2011, 6:40pm UTC](https://discuss.elastic.co/t/no-type-request/4267 "2011-04-20T18:40:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![davrob](https://avatars.discourse-cdn.com/v4/letter/d/d78d45/32.png) [@davrob](https://discuss.elastic.co/u/davrob)\
**Post date:** [April 20, 2011, 6:40pm UTC](https://discuss.elastic.co/t/no-type-request/4267/1 "2011-04-20T18:40:16Z")

</div>

I would like to do a Request on an alias without any type, or else to  
specify all possible types. So far I can only see how to do a query  
like this with the Java API:

```
    getClient().prepareGet().setIndex(getIndexName()).setId("" +

```

contactId).setType(null)

Which throws a validation "type is missing" error.

David.

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [April 20, 2011, 10:45pm UTC](https://discuss.elastic.co/t/no-type-request/4267/2 "2011-04-20T22:45:24Z")

</div>

Hey, you need to provide both the type and the id to fetch a document.  
On Wednesday, April 20, 2011 at 9:40 PM, davrob2 wrote:

> I would like to do a Request on an alias without any type, or else to  
> specify all possible types. So far I can only see how to do a query  
> like this with the Java API:
> 
> getClient().prepareGet().setIndex(getIndexName()).setId("" +  
> contactId).setType(null)
> 
> Which throws a validation "type is missing" error.
> 
> David.

---

<div class="post-metadata">

**Author:** ![davrob](https://avatars.discourse-cdn.com/v4/letter/d/d78d45/32.png) [@davrob](https://discuss.elastic.co/u/davrob)\
**Post date:** [April 21, 2011, 9:48am UTC](https://discuss.elastic.co/t/no-type-request/4267/3 "2011-04-21T09:48:20Z")

</div>

Is there a way that I can specify to search across all types in the  
index? e.g. .setTypes("type1","type2","type3")

On Apr 20, 11:45 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:

> Hey, you need to provide both the type and the id to fetch a document.
> 
> On Wednesday, April 20, 2011 at 9:40 PM, davrob2 wrote:
> 
> > I would like to do a Request on an alias without any type, or else to  
> > specify all possible types. So far I can only see how to do a query  
> > like this with the Java API:
> 
> > getClient().prepareGet().setIndex(getIndexName()).setId("" +  
> > contactId).setType(null)
> 
> > Which throws a validation "type is missing" error.
> 
> > David.

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [April 21, 2011, 10:09am UTC](https://discuss.elastic.co/t/no-type-request/4267/4 "2011-04-21T10:09:32Z")

</div>

Hi David

On Thu, 2011-04-21 at 02:48 -0700, davrob2 wrote:

> Is there a way that I can specify to search across all types in the  
> index? e.g. .setTypes("type1","type2","type3")

You can search across all types, or a list of types.

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

I'm not sure how that is implemented in the Java API

clint

---

<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, 4:07am UTC](https://discuss.elastic.co/t/no-type-request/4267/5 "2017-07-06T04:07:59Z")

</div>


