Get mapping api in 0.19.0


(avasilenko) #1

Hello,

I remember it was impossible to retrieve index mappings via java api.
Workaround was to use REST api. Are there any improvements in java api for
0.19.0?

Thanks,
Alexandr Vasilenko


(Shay Banon) #2

You can use the Java API to get the mapping. Note that all REST endpoints use the Java API to do the actual work, so there isn't anything you can do with rest that you can't do with Java. Some REST endpoints though are more concrete or specialized and use a more generic Java API.

In this case, getting the mapping uses the cluster state API. Here is the REST implementation: https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/rest/action/admin/indices/mapping/get/RestGetMappingAction.java#L66.

On Tuesday, March 6, 2012 at 8:08 PM, Alex Vasilenko wrote:

Hello,

I remember it was impossible to retrieve index mappings via java api. Workaround was to use REST api. Are there any improvements in java api for 0.19.0?

Thanks,
Alexandr Vasilenko


(avasilenko) #3

Thanks Shay. Next time I'll check source first.

Alex

2012/3/6 Shay Banon kimchy@gmail.com

You can use the Java API to get the mapping. Note that all REST endpoints
use the Java API to do the actual work, so there isn't anything you can do
with rest that you can't do with Java. Some REST endpoints though are more
concrete or specialized and use a more generic Java API.

In this case, getting the mapping uses the cluster state API. Here is the
REST implementation:
https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/rest/action/admin/indices/mapping/get/RestGetMappingAction.java#L66
.

On Tuesday, March 6, 2012 at 8:08 PM, Alex Vasilenko wrote:

Hello,

I remember it was impossible to retrieve index mappings via java api.
Workaround was to use REST api. Are there any improvements in java api for
0.19.0?

Thanks,
Alexandr Vasilenko


(system) #4