Http GET without BODY

hi everyone --

after watching this bonsai-cool project for a while I am finally ready to
start using it.

my http client does not support BODY in GET requests, so following the
comment in http://www.elasticsearch.org/guide/reference/api/ that suggested
using a query string parameter named "source" instead.

I added 5 test documents with the following information:

{ "name" : "Shay Banon", "org" : "Elastic Search" }
{ "name" : "Michael Offner", "org" : "Railo" }
{ "name" : "Igal Sapir", "org" : "Railo" }
{ "name" : "Uwe Schindler", "org" : "Lucene Search" }
{ "name" : "Michael McCandless", "org" : "Lucene Search" }

now if I execute the following GET request:

http://localhost:9200/index/type/_search?q=Search

I get the correct results, which are the 3 documents with the word "Search"

but I can not produce the same results with the "source" param.

what would be the SOURCE equivalent to "q=Search"?

thanks,

Igal

--
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.

Most http clients do not support GET requests with a body which is why ES
also supports executing searches using a POST or the source parameter as
you mention. Using POST is going to be the best approach if possible. At
any rate, the body equivalent of using the q parameter is:

{"query":{"query_string":{"query":"Search"}}}

Thanks,
Matt Weber

On Thu, Jun 6, 2013 at 10:56 AM, Igal igal@getrailo.org wrote:

hi everyone --

after watching this bonsai-cool project for a while I am finally ready to
start using it.

my http client does not support BODY in GET requests, so following the
comment in Elasticsearch Platform — Find real-time answers at scale | Elastic that
suggested using a query string parameter named "source" instead.

I added 5 test documents with the following information:

{ "name" : "Shay Banon", "org" : "Elastic Search" }
{ "name" : "Michael Offner", "org" : "Railo" }
{ "name" : "Igal Sapir", "org" : "Railo" }
{ "name" : "Uwe Schindler", "org" : "Lucene Search" }
{ "name" : "Michael McCandless", "org" : "Lucene Search" }

now if I execute the following GET request:

http://localhost:9200/index/type/_search?q=Search

I get the correct results, which are the 3 documents with the word "Search"

but I can not produce the same results with the "source" param.

what would be the SOURCE equivalent to "q=Search"?

thanks,

Igal

--
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.

--
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 Matt :slight_smile:

On 6/6/2013 11:06 AM, Matt Weber wrote:

Most http clients do not support GET requests with a body which is why
ES also supports executing searches using a POST or the source
parameter as you mention. Using POST is going to be the best approach
if possible. At any rate, the body equivalent of using the q
parameter is:

{"query":{"query_string":{"query":"Search"}}}

Thanks,
Matt Weber

On Thu, Jun 6, 2013 at 10:56 AM, Igal <igal@getrailo.org
mailto:igal@getrailo.org> wrote:

hi everyone --

after watching this bonsai-cool project for a while I am finally
ready to start using it.

my http client does not support BODY in GET requests, so following
the comment in
http://www.elasticsearch.org/guide/reference/api/ that suggested
using a query string parameter named "source" instead.

I added 5 test documents with the following information:

{ "name" : "Shay Banon",         "org" : "Elastic Search" }
{ "name" : "Michael Offner",     "org" : "Railo" }
{ "name" : "Igal Sapir",         "org" : "Railo" }
{ "name" : "Uwe Schindler",      "org" : "Lucene Search" }
{ "name" : "Michael McCandless", "org" : "Lucene Search" }

now if I execute the following GET request:

http://localhost:9200/index/type/_search?q=Search

I get the correct results, which are the 3 documents with the word
"Search"

but I can not produce the same results with the "source" param.

what would be the SOURCE equivalent to "q=Search"?

thanks,


Igal
-- 
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
<mailto:elasticsearch%2Bunsubscribe@googlegroups.com>.
For more options, visit https://groups.google.com/groups/opt_out.

--
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/BY2Hf-mgL3E/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.

--
Igal Sapir
Railo Core Developer

--
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.