Passing JSON string in URL (query string) to _percolate


(jschelle-2) #1

ElasticSearch claims that"for libraries don't support have a body for an
HTTP GET call, you can use the source variable in the URL query string.
However after days, I can't get this to work for a _percolate call. Has
anyone done this?? I'm using Java and trying to compare performance of
straight HTTP to the Java API.

here it is in CURL:

curl -XPOST 'http://localhost:9200/test5/site' -d
'{"query":{"term":{"content":"jason"}}}'

curl -XGET
'http://localhost:9200/test5/site/_percolate?source={"doc":{"content":jason"}}'
{"error":"ElasticSearchParseException[Failed to derive xcontent from
(offset=0, length=0): []]","status":400}

The error message sounds like its not even noticing the source parameter.
Has anyone successfully done this? In any language??

Please help, thanks.


(Shay Banon) #2

Passing source as a parameter is not supported for percolate (source is
supported for search operations). You can use POST as well, no just GET.
Where did you find that comment?

On Fri, Apr 27, 2012 at 4:02 PM, jschelle jason.scheller@gmail.com wrote:

ElasticSearch claims that"for libraries don't support have a body for an
HTTP GET call, you can use the source variable in the URL query string.
However after days, I can't get this to work for a _percolate call. Has
anyone done this?? I'm using Java and trying to compare performance of
straight HTTP to the Java API.

here it is in CURL:

curl -XPOST 'http://localhost:9200/test5/site' -d
'{"query":{"term":{"content":"jason"}}}'

curl -XGET 'http://localhost:9200/test5/site/_percolate?source={
"doc":{"content":jason"}}'
{"error":"ElasticSearchParseException[Failed to derive xcontent from
(offset=0, length=0): []]","status":400}

The error message sounds like its not even noticing the source parameter.
Has anyone successfully done this? In any language??

Please help, thanks.


(system) #3