No Type Request


(davrob) #1

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.


(Shay Banon) #2

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.


(davrob) #3

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


(Clinton Gormley) #4

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


(system) #5