Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

es hadoop query all type #583

Closed
adol001 opened this issue Oct 28, 2015 · 6 comments
Closed

es hadoop query all type #583

adol001 opened this issue Oct 28, 2015 · 6 comments

Comments

@adol001
Copy link

adol001 commented Oct 28, 2015

it seems it must be point a index type follow index name, even if you can use multi type for search like this(https://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html#search-multi-index-type) in es hadoop

For example:"table/partition" is a good resource for esRdd to read,but only "table" can't satisfy the format (Exception in thread "main" org.elasticsearch.hadoop.EsHadoopIllegalArgumentException: invalid resource given; expecting [index]/[type] - received table)

@costin
Copy link
Member

costin commented Oct 28, 2015

Sorry I'm not following. Can you explain what index/type are you trying to use and it's not working?

Thanks,

@adol001
Copy link
Author

adol001 commented Oct 28, 2015

I have a index named "error_info7" with a type named "20150104", if I run spark code
sc.esRDD("error_info7/20150104,20150105", q)
is ok
But I run
sc.esRDD("error_info7", q)
it will return error message
Exception in thread "main" org.elasticsearch.hadoop.EsHadoopIllegalArgumentException: invalid resource given; expecting [index]/[type] - received error_info7

How can I query all type in an index, or don't declare index type to query whole index with es-hadoop

@costin
Copy link
Member

costin commented Oct 28, 2015

error_info7/_all ?

@adol001
Copy link
Author

adol001 commented Oct 28, 2015

It doesn't work. According to official document, you can use _all to replace index for cross multi index query, but I find nothing about all type placeholder

Using es-hadoop 2.2.0-m1

@costin
Copy link
Member

costin commented Oct 28, 2015

@adol001 thanks. I'll look into it and report back.

@costin
Copy link
Member

costin commented Oct 28, 2015

I've pushed a fix in master that allows the resource to be skipped. Note that this will only work for reading and when the schema is likely the same across types.

@costin costin closed this as completed Oct 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants