Request for list of Elasticsearch operations only thru URL


(shannu) #1

Hello,

Is there a list elasticsearch operations that we can perform thru uri
request ? If yes could someone point me to the location.

Also is it possible to add lucene syntax to the url,

for example:
http://es.XYZServer:9200/_search?pretty=true{"query":{"term":"SampleText"}}

  • // this doesnt work for me..

Tried few other things and worked:

1: Search for text:
http://es.XYZServer:9200/_search?q=yoursearchword

2: Search for mulitple keywords(with OR):
http://es.XYZServer:9200/_search?q=Keyword1 OR Keyword2 OR Keyword3

3: Search for mulitple keywords(with AND):
http://es.XYZServer:9200/_search?q=Keyword1 AND Keyword2 AND Keyword3

4: Search for a specific document where the fieldvalue=xyz :
http://es.XYZServer:9200/_search?q=_source.FieldName=value

5: perform step 4 with sort Enabled:
http://es.XYZServer:9200/_search?q=_source.FieldName=value&sort=fieldname
(by deafult its ascending)
would like to know how I can change the order to desc ???

6: use Size to change the default(10) results list
http://es.XYZServer:9200/_search?size=numeric value(for example size=20)

7: Check the stats of the cluster:
http://es.XYZServer:9200/_cluster/nodes/stats?pretty=true

Hope the above ElasticSearch REST URL Quick Reference will be useful for
someone.

Would like to request if someone can post some more usefull uri requests
that work.

would like to know how we can group by fieldname ?
would like to know how I can change the sort order to desc ???
filter results based on a datefield range ?
how to delete documents if the index size is growing?

Thanks in Advance,
Shannu.

--


(Derry O' Sullivan) #2

Hi Shanu

On Thursday, 4 October 2012 14:58:04 UTC+1, shannu wrote:

Hello,

Is there a list elasticsearch operations that we can perform thru uri
request ? If yes could someone point me to the location.

Also is it possible to add lucene syntax to the url,

for example: http://es.XYZServer:9200/_search?pretty=true{"query":{"term":"SampleText"}}

  • // this doesnt work for me..

Worth checking out:
http://www.elasticsearch.org/guide/reference/api/search/request-body.html

Query DSL is more what you want to use, i guess?

Tried few other things and worked:

It's worth looking through the docs at (
http://www.elasticsearch.org/guide/reference/api/) as all these commands
and others are covered there.

1: Search for text:
http://es.XYZServer:9200/_search?q=yoursearchword

2: Search for mulitple keywords(with OR):
http://es.XYZServer:9200/_search?q=Keyword1 OR Keyword2 OR Keyword3

3: Search for mulitple keywords(with AND):
http://es.XYZServer:9200/_search?q=Keyword1 AND Keyword2 AND Keyword3

4: Search for a specific document where the fieldvalue=xyz :
http://es.XYZServer:9200/_search?q=_source.FieldName=value

5: perform step 4 with sort Enabled:
http://es.XYZServer:9200/_search?q=_source.FieldName=value&sort=fieldname(by deafult its ascending)
would like to know how I can change the order to desc ???

http://es.XYZServer:9200/_search?q=_source.FieldName=value&sort=fieldnamehttp://es.xyzserver:9200/_search?q=_source.FieldName=value&sort=fieldname
:desc

also can do:
http://es.XYZServer:9200/_search?q=FieldName:value&sort=fieldnamehttp://es.xyzserver:9200/_search?q=_source.FieldName=value&sort=fieldname
:desc

6: use Size to change the default(10) results list
http://es.XYZServer:9200/_search?size=numeric value(for example size=20)

7: Check the stats of the cluster:
http://es.XYZServer:9200/_cluster/nodes/stats?pretty=true

Hope the above ElasticSearch REST URL Quick Reference will be useful for
someone.

Would like to request if someone can post some more usefull uri requests
that work.

would like to know how we can group by fieldname ?

I'm not sure what you mean by grouping - you can probably use query DSL to
filter/facet/query in any way you want

would like to know how I can change the sort order to desc ???

as in example above: sort=fieldName:desc

filter results based on a datefield range ?

See example in doc on github (section on searching):

how to delete documents if the index size is growing?

http://www.elasticsearch.org/guide/reference/api/delete.html
http://www.elasticsearch.org/guide/reference/api/delete-by-query.html

Thanks in Advance,
Shannu.

--


(shannu) #3

Hi Derry,

Thanks a ton for the quick reply :slight_smile: Sort=fieldname:desc works perfectly
fine...

will look at the other bits as well..

Once again many many thanks.

Cheers,
Shannu.

On Thursday, October 4, 2012 4:03:31 PM UTC+1, Derry O' Sullivan wrote:

Hi Shanu

On Thursday, 4 October 2012 14:58:04 UTC+1, shannu wrote:

Hello,

Is there a list elasticsearch operations that we can perform thru uri
request ? If yes could someone point me to the location.

Also is it possible to add lucene syntax to the url,

for example: http://es.XYZServer:9200/_search?pretty=true{"query":{"term":"SampleText"}}

  • // this doesnt work for me..

Worth checking out:
http://www.elasticsearch.org/guide/reference/api/search/request-body.html

Query DSL is more what you want to use, i guess?

Tried few other things and worked:

It's worth looking through the docs at (
http://www.elasticsearch.org/guide/reference/api/) as all these commands
and others are covered there.

1: Search for text:
http://es.XYZServer:9200/_search?q=yoursearchword

2: Search for mulitple keywords(with OR):
http://es.XYZServer:9200/_search?q=Keyword1 OR Keyword2 OR Keyword3

3: Search for mulitple keywords(with AND):
http://es.XYZServer:9200/_search?q=Keyword1 AND Keyword2 AND Keyword3

4: Search for a specific document where the fieldvalue=xyz :
http://es.XYZServer:9200/_search?q=_source.FieldName=value

5: perform step 4 with sort Enabled:
http://es.XYZServer:9200/_search?q=_source.FieldName=value&sort=fieldname(by deafult its ascending)
would like to know how I can change the order to desc ???

http://es.XYZServer:9200/_search?q=_source.FieldName=value&sort=fieldnamehttp://es.xyzserver:9200/_search?q=_source.FieldName=value&sort=fieldname
:desc

also can do:
http://es.XYZServer:9200/_search?q=FieldName:value&sort=fieldnamehttp://es.xyzserver:9200/_search?q=_source.FieldName=value&sort=fieldname
:desc

6: use Size to change the default(10) results list
http://es.XYZServer:9200/_search?size=numeric value(for example size=20)

7: Check the stats of the cluster:
http://es.XYZServer:9200/_cluster/nodes/stats?pretty=true

Hope the above ElasticSearch REST URL Quick Reference will be useful for
someone.

Would like to request if someone can post some more usefull uri requests
that work.

would like to know how we can group by fieldname ?

I'm not sure what you mean by grouping - you can probably use query DSL to
filter/facet/query in any way you want

would like to know how I can change the sort order to desc ???

as in example above: sort=fieldName:desc

filter results based on a datefield range ?

See example in doc on github (section on searching):
https://github.com/elasticsearch/elasticsearch

how to delete documents if the index size is growing?

http://www.elasticsearch.org/guide/reference/api/delete.html
http://www.elasticsearch.org/guide/reference/api/delete-by-query.html

Thanks in Advance,
Shannu.

--


(Ivan Brusic) #4

You also might want to check out everything in
the org.elasticsearch.rest.action package

https://github.com/elasticsearch/elasticsearch/tree/master/src/main/java/org/elasticsearch/rest/action

--
Ivan

On Thu, Oct 4, 2012 at 8:03 AM, Derry O' Sullivan derryos@gmail.com wrote:

Worth checking out:
http://www.elasticsearch.org/guide/reference/api/search/request-body.html

--


(shannu) #5

Hey Ivan,

Thanks a lot :slight_smile:

Cheers,
Shannu.

On Thursday, October 4, 2012 11:18:21 PM UTC+1, Ivan Brusic wrote:

You also might want to check out everything in
the org.elasticsearch.rest.action package

https://github.com/elasticsearch/elasticsearch/tree/master/src/main/java/org/elasticsearch/rest/action

--
Ivan

On Thu, Oct 4, 2012 at 8:03 AM, Derry O' Sullivan <der...@gmail.com<javascript:>

wrote:

Worth checking out:
http://www.elasticsearch.org/guide/reference/api/search/request-body.html

--


(system) #6