Types metadata information in an Index?

Hi,

Is there a Java API where i can find out all the types defined in an index
and also metadata information of each type. For example what are the
fields, type of a field, etc ?

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

I think you are looking mapping of a index type. Here is a code snippet,
where I get the mapping as a string in Java.

ClusterState clusterState =
client.admin().cluster().prepareState().setFilterIndices(index).execute().actionGet().getState();

IndexMetaData indexMetaData = clusterState.getMetaData().index(index);

MappingMetaData mappingMetaData = indexMetaData.mapping(type);

return mappingMetaData.getSourceAsMap().toString();

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Thanks that works.

On Fri, Apr 26, 2013 at 2:39 PM, Fish Tastic whoisbingo@gmail.com wrote:

I think you are looking mapping of a index type. Here is a code snippet,
where I get the mapping as a string in Java.

ClusterState clusterState =
client.admin().cluster().prepareState().setFilterIndices(index).execute().actionGet().getState();

IndexMetaData indexMetaData = clusterState.getMetaData().index(index);

MappingMetaData mappingMetaData = indexMetaData.mapping(type);

return mappingMetaData.getSourceAsMap().toString();

--
You received this message because you are subscribed to a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/NGnUSgAAfLs/unsubscribe?hl=en-US
.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.