No Type Request

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

No Type Request

davrob
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.
Reply | Threaded
Open this post in threaded view
|

Re: No Type Request

kimchy
Administrator
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.

Reply | Threaded
Open this post in threaded view
|

Re: No Type Request

davrob
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 <[hidden email]> 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.
Reply | Threaded
Open this post in threaded view
|

Re: No Type Request

Clinton Gormley
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.

http://www.elasticsearch.org/guide/reference/api/search/indices-types.html

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

clint