If I create a index like:
PUT /test
{
"type": "test",
"fs": {
"url": "c:\temp",
"update_rate": "1h"
}
}
I will get this settings of the Index with a RestHandler in a Plugin.
MyQuestion is wich Resthandler can I use to get the IndexSettings?
If I create a index like:
PUT /test
{
"type": "test",
"fs": {
"url": "c:\temp",
"update_rate": "1h"
}
}
I will get this settings of the Index with a RestHandler in a Plugin.
MyQuestion is wich Resthandler can I use to get the IndexSettings?
What information do you want to get exactly?
For basic informations about the count of documents or the status of the index you can use the following command:
curl 'localhost:9200/_cat/indices?v'
Cheers,
Alex
I write a plugin. If a Index created, i will get the index settings.
The BaseRestHandler (public class ManageIndicesRestActions extends BaseRestHandler) get only the Index Name.
But I will get the Settings of the Index:
PUT /test
{
"type": "test",
"fs": {
"url": "c:\temp",
"update_rate": "1h"
}
}
Hmm.. I'm not quite sure if I got your question..
You create an index with a command like the following:
curl -XPUT 'localhost:9200/test?pretty' -d '
{
"mappings": {....}
}'
Once you've done that, you can add items e.g.
PUT /test
{
"type": "test",
"fs": {
"url": "c:\temp",
"update_rate": "1h"
}
}
If you want to get deeper informations about the index, you can use the stats API:
https://www.elastic.co/guide/en/elasticsearch/reference/1.x/indices-stats.html
Does that help you?
No that was not my question.
Also I write a plugin with a RestController:
public class ManageIndicesRestActions extends BaseRestHandler {{
@Inject
public ManageIndicesRestActions(Settings settings, final Client client,
final RestController controller) {
super(settings, controller, client);
/* close index */
controller.registerHandler(Method.POST, "/{index}/_close", this);
controller.registerHandler(Method.PUT, "/{index}/_close", this);
/* open index */
controller.registerHandler(Method.POST, "/{index}/_open", this);
controller.registerHandler(Method.PUT, "/{index}/_open", this);
/* create index */
controller.registerHandler(Method.POST, "/{index}", this);
controller.registerHandler(Method.PUT, "/{index}", this);
}
If a create a Index with
PUT /test
{
"type": "test",
"fs": {
"url": "c:\temp",
"update_rate": "1h"
}
}
then this Controller handleRequest Method is called. In this Method I receive only the Index name and not the others settings like "url, uodate_rate,,,,,,"
© 2020. All Rights Reserved - Elasticsearch
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant logo are trademarks of the Apache Software Foundation in the United States and/or other countries.