Multiple parameter in a query in URI request

Hi,

I am searching an already existing index. I am using below curl request
which is working fine:

curl -XGET 'http://logstash:9200/_search?q=user:myname'

Now I want to add another parameters address:myaddress and size=10 to above
query. How can I add these to the above request?

Thanks.

--

On Fri, 2013-01-18 at 11:02 -0800, Jimi Parekh wrote:

Hi,

I am searching an already existing index. I am using below curl
request which is working fine:

curl -XGET 'http://logstash:9200/_search?q=user:myname'

Now I want to add another parameters address:myaddress and size=10 to
above query. How can I add these to the above request?

curl -XGET 'http://logstash:9200/_search?q=user:myname%20address:(my address)&size=10'

--

Clinton,

I think this is adding 'OR' condition and showing the result matching both
the criteria. I want 'AND' condition.

On Friday, January 18, 2013 2:04:33 PM UTC-5, Clinton Gormley wrote:

On Fri, 2013-01-18 at 11:02 -0800, Jimi Parekh wrote:

Hi,

I am searching an already existing index. I am using below curl
request which is working fine:

curl -XGET 'http://logstash:9200/_search?q=user:myname'

Now I want to add another parameters address:myaddress and size=10 to
above query. How can I add these to the above request?

curl -XGET 'http://logstash:9200/_search?q=user:myname%20address:(myhttp://logstash:9200/_search?q=user:myname%20address:(myaddress)&size=10'

--

On Fri, 2013-01-18 at 12:39 -0800, Jimi Parekh wrote:

Clinton,

I think this is adding 'OR' condition and showing the result matching
both the criteria. I want 'AND' condition.

Prepend a + before each required condition (+ is encoded as %2B)

curl -XGET 'http://logstash:9200/_search?q=%2Buser:myname%20%2Baddress:(my address)&size=10'

clint

--

1 Like