I've been searching the docs for the last few hours trying to find out how
to do make a HEAD request to ES in java and I can't find anything about it.
Basically I'm trying to find out if a document exists in the most light
weight way, the obvious solution was to use a http HEAD request but the
closest I could find was
client.admin().indices().prepareExists("contents").execute().actionGet();
but that's only for checking whether the index exists not a document.
Is it even possible to do the equivalent of a HEAD request in java for ES
(using 0.19.11 by the way), if it does exist then if someone could point me
in the right direction that'd be great
I've been searching the docs for the last few hours trying to find out how to do make a HEAD request to ES in java and I can't find anything about it.
Basically I'm trying to find out if a document exists in the most light weight way, the obvious solution was to use a http HEAD request but the closest I could find was
client.admin().indices().prepareExists("contents").execute().actionGet();
but that's only for checking whether the index exists not a document.
Is it even possible to do the equivalent of a HEAD request in java for ES (using 0.19.11 by the way), if it does exist then if someone could point me in the right direction that'd be great
Since the Java clients (NodeClient, TransportClient) of Elasticsearch do
not use HTTP at all, it is no surprise that there is no HTTP HEAD client
request for the RestHeadAction at all.
FYI in my upcoming Java HTTP client project, which can connect to the REST
API, but maintains API compatibility to the TransportClient, I have added a
sketch for such a HEAD method action to the GetRequest, checking for a
document existence
where returning a 'null' if no document existed is rather a kludge.
The client project is not announced yet, the project and it's documentation
is still work in progress...
Best regards,
Jörg
On Wednesday, November 28, 2012 9:03:18 PM UTC+1, chris harrington wrote:
I've been searching the docs for the last few hours trying to find out how
to do make a HEAD request to ES in java and I can't find anything about it.
Basically I'm trying to find out if a document exists in the most light
weight way, the obvious solution was to use a http HEAD request but the
closest I could find was
client.admin().indices().prepareExists("contents").execute().actionGet();
but that's only for checking whether the index exists not a document.
Is it even possible to do the equivalent of a HEAD request in java for ES
(using 0.19.11 by the way), if it does exist then if someone could point me
in the right direction that'd be great
On Wednesday, November 28, 2012 3:03:18 PM UTC-5, chris harrington wrote:
I've been searching the docs for the last few hours trying to find out how
to do make a HEAD request to ES in java and I can't find anything about it.
Basically I'm trying to find out if a document exists in the most light
weight way, the obvious solution was to use a http HEAD request but the
closest I could find was
client.admin().indices().prepareExists("contents").execute().actionGet();
but that's only for checking whether the index exists not a document.
Is it even possible to do the equivalent of a HEAD request in java for ES
(using 0.19.11 by the way), if it does exist then if someone could point me
in the right direction that'd be great
Ok thanks guys, was hoping there was exists call on an item but looks like
I'll have to use a get request.
On Wednesday, 28 November 2012 20:03:18 UTC, chris harrington wrote:
I've been searching the docs for the last few hours trying to find out how
to do make a HEAD request to ES in java and I can't find anything about it.
Basically I'm trying to find out if a document exists in the most light
weight way, the obvious solution was to use a http HEAD request but the
closest I could find was
client.admin().indices().prepareExists("contents").execute().actionGet();
but that's only for checking whether the index exists not a document.
Is it even possible to do the equivalent of a HEAD request in java for ES
(using 0.19.11 by the way), if it does exist then if someone could point me
in the right direction that'd be great
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.