# Newbies testing out ElasticSearch alternative to Curl

**URL:** <https://discuss.elastic.co/t/newbies-testing-out-elasticsearch-alternative-to-curl/10333>\
**Category:** Elasticsearch\
**Created:** [January 14, 2013, 5:26pm UTC](https://discuss.elastic.co/t/newbies-testing-out-elasticsearch-alternative-to-curl/10333 "2013-01-14T17:26:29Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Justin\_Treher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/justin_treher/32/45243_2.png) [@Justin\_Treher](https://discuss.elastic.co/u/Justin_Treher)\
**Post date:** [January 14, 2013, 5:26pm UTC](https://discuss.elastic.co/t/newbies-testing-out-elasticsearch-alternative-to-curl/10333/1 "2013-01-14T17:26:29Z")

</div>

Hi!

I have ElasticSearch running in my linux VM to test drive this alternative  
to SOLR. I'd really prefer just to use a REST "tester" client such as  
Poster for FireFox rather than retyping examples into curl or the annoying  
issues with copy/paste into bash shell. I've tried most of the other addins  
and none of them support sending body with a GET. They only seem to allow  
payload for PUT and POST.

What do you use other than Curl available as a browser extension or windows  
software?

--

---

<div class="post-metadata">

**Author:** ![polyfractal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/polyfractal/32/48162_2.png) [@polyfractal](https://discuss.elastic.co/u/polyfractal)\
**Post date:** [January 14, 2013, 5:34pm UTC](https://discuss.elastic.co/t/newbies-testing-out-elasticsearch-alternative-to-curl/10333/2 "2013-01-14T17:34:17Z")

</div>

Elasticsearch-Head (graphical frontend GUI to a cluster) allows you to make  
arbitrary REST requests: [http://mobz.github.com/elasticsearch-head/](http://mobz.github.com/elasticsearch-head/)

Otherwise, I often use curl via php scripts to test out new queries.

-Zach

On Monday, January 14, 2013 12:26:29 PM UTC-5, [jtr...@gmail.com](mailto:jtr...@gmail.com) wrote:

> Hi!
> 
> I have Elasticsearch running in my linux VM to test drive this alternative  
> to SOLR. I'd really prefer just to use a REST "tester" client such as  
> Poster for FireFox rather than retyping examples into curl or the annoying  
> issues with copy/paste into bash shell. I've tried most of the other addins  
> and none of them support sending body with a GET. They only seem to allow  
> payload for PUT and POST.
> 
> What do you use other than Curl available as a browser extension or  
> windows software?

--

---

<div class="post-metadata">

**Author:** ![Justin\_Treher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/justin_treher/32/45243_2.png) [@Justin\_Treher](https://discuss.elastic.co/u/Justin_Treher)\
**Post date:** [January 14, 2013, 6:26pm UTC](https://discuss.elastic.co/t/newbies-testing-out-elasticsearch-alternative-to-curl/10333/3 "2013-01-14T18:26:10Z")

</div>

Excellent. That works very well. This is much better than CURL or having a  
gigantic JSON packet in the URL bar.

Thanks!

On Monday, January 14, 2013 12:26:29 PM UTC-5, [jtr...@gmail.com](mailto:jtr...@gmail.com) wrote:

> Hi!
> 
> I have Elasticsearch running in my linux VM to test drive this alternative  
> to SOLR. I'd really prefer just to use a REST "tester" client such as  
> Poster for FireFox rather than retyping examples into curl or the annoying  
> issues with copy/paste into bash shell. I've tried most of the other addins  
> and none of them support sending body with a GET. They only seem to allow  
> payload for PUT and POST.
> 
> What do you use other than Curl available as a browser extension or  
> windows software?

--

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 14, 2013, 6:42pm UTC](https://discuss.elastic.co/t/newbies-testing-out-elasticsearch-alternative-to-curl/10333/4 "2013-01-14T18:42:42Z")

</div>

Better is a matter of point of view.  
What I love with curl commands is that it allows to create full curl recreation scripts when you need help.

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

See for exemple: [Test case for multifield fields · GitHub](https://gist.github.com/2965777)

That said, Head is a very cool interface to play with ES! 😉

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 14 janv. 2013 à 19:26, [jtreher@gmail.com](mailto:jtreher@gmail.com) a écrit :

> Excellent. That works very well. This is much better than CURL or having a gigantic JSON packet in the URL bar.
> 
> Thanks!
> 
> On Monday, January 14, 2013 12:26:29 PM UTC-5, [jtr...@gmail.com](mailto:jtr...@gmail.com) wrote:
> 
> > Hi!
> > 
> > I have Elasticsearch running in my linux VM to test drive this alternative to SOLR. I'd really prefer just to use a REST "tester" client such as Poster for FireFox rather than retyping examples into curl or the annoying issues with copy/paste into bash shell. I've tried most of the other addins and none of them support sending body with a GET. They only seem to allow payload for PUT and POST.
> > 
> > What do you use other than Curl available as a browser extension or windows software?
> 
> --

--

---

<div class="post-metadata">

**Author:** ![polyfractal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/polyfractal/32/48162_2.png) [@polyfractal](https://discuss.elastic.co/u/polyfractal)\
**Post date:** [January 14, 2013, 6:55pm UTC](https://discuss.elastic.co/t/newbies-testing-out-elasticsearch-alternative-to-curl/10333/5 "2013-01-14T18:55:48Z")

</div>

Yeah, I like raw curl from the command line too.

ES-Head does weird things sometimes, usually if you have a JSON validation  
error or a mismatched HTTP method (using POST instead of PUT for certain  
commands). Instead of returning an error...it just spins forever and shows  
a blank page.

-Zach

On Monday, January 14, 2013 1:42:42 PM UTC-5, David Pilato wrote:

> Better is a matter of point of view.  
> What I love with curl commands is that it allows to create full curl  
> recreation scripts when you need help.  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/help)
> 
> See for exemple: [Test case for multifield fields · GitHub](https://gist.github.com/2965777)
> 
> That said, Head is a very cool interface to play with ES! 😉
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 14 janv. 2013 à 19:26, [jtr...@gmail.com](mailto:jtr...@gmail.com) \<javascript:\> a écrit :
> 
> Excellent. That works very well. This is much better than CURL or having a  
> gigantic JSON packet in the URL bar.
> 
> Thanks!
> 
> On Monday, January 14, 2013 12:26:29 PM UTC-5, [jtr...@gmail.com](mailto:jtr...@gmail.com) wrote:
> 
> > Hi!
> > 
> > I have Elasticsearch running in my linux VM to test drive this  
> > alternative to SOLR. I'd really prefer just to use a REST "tester" client  
> > such as Poster for FireFox rather than retyping examples into curl or the  
> > annoying issues with copy/paste into bash shell. I've tried most of the  
> > other addins and none of them support sending body with a GET. They only  
> > seem to allow payload for PUT and POST.
> > 
> > What do you use other than Curl available as a browser extension or  
> > windows software?
> > 
> > --

--

---

<div class="post-metadata">

**Author:** ![Justin\_Treher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/justin_treher/32/45243_2.png) [@Justin\_Treher](https://discuss.elastic.co/u/Justin_Treher)\
**Post date:** [January 14, 2013, 9:22pm UTC](https://discuss.elastic.co/t/newbies-testing-out-elasticsearch-alternative-to-curl/10333/6 "2013-01-14T21:22:57Z")

</div>

I hear you on "better." I'm still in the "what the....?" phase. I'm sure  
curl will be preferred once I'm no longer working with heavy web examples.

That being said, how the heck do I get this to work correctly? I'm not sure  
how to provide parameters for "playground testing" via the \_analyze API.

localhost:9200/\_analyze?tokenizer=edgeNGram&min\_gram=1&max\_gram=20&text=something

On Monday, January 14, 2013 1:42:42 PM UTC-5, David Pilato wrote:

> Better is a matter of point of view.  
> What I love with curl commands is that it allows to create full curl  
> recreation scripts when you need help.  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/help)
> 
> See for exemple: [Test case for multifield fields · GitHub](https://gist.github.com/2965777)
> 
> That said, Head is a very cool interface to play with ES! 😉
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 14 janv. 2013 à 19:26, [jtr...@gmail.com](mailto:jtr...@gmail.com) \<javascript:\> a écrit :
> 
> Excellent. That works very well. This is much better than CURL or having a  
> gigantic JSON packet in the URL bar.
> 
> Thanks!
> 
> On Monday, January 14, 2013 12:26:29 PM UTC-5, [jtr...@gmail.com](mailto:jtr...@gmail.com) wrote:
> 
> > Hi!
> > 
> > I have Elasticsearch running in my linux VM to test drive this  
> > alternative to SOLR. I'd really prefer just to use a REST "tester" client  
> > such as Poster for FireFox rather than retyping examples into curl or the  
> > annoying issues with copy/paste into bash shell. I've tried most of the  
> > other addins and none of them support sending body with a GET. They only  
> > seem to allow payload for PUT and POST.
> > 
> > What do you use other than Curl available as a browser extension or  
> > windows software?
> > 
> > --

--

---

<div class="post-metadata">

**Author:** ![polyfractal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/polyfractal/32/48162_2.png) [@polyfractal](https://discuss.elastic.co/u/polyfractal)\
**Post date:** [January 14, 2013, 9:51pm UTC](https://discuss.elastic.co/t/newbies-testing-out-elasticsearch-alternative-to-curl/10333/7 "2013-01-14T21:51:34Z")

</div>

I don't believe you can specify tokenizer settings directly through the  
\_Analyze API. You could do:

curl -X GET "localhost:9200/\_analyze?tokenizer=edgeNGram" -d "this is  
example text"

...but that will use the defaults for edgeNGram (min\_gram = 1, etc). Or  
you could use an custom analyzer which sets the appropriate settings. Note  
that this query uses a test index, since analyzer mappings are per-index:

curl -X GET "localhost:9200/test/\_analyze?analyzer=analyzer\_edgeNGram" -d  
"this is example text"

-Zach

On Monday, January 14, 2013 4:22:57 PM UTC-5, [jtr...@gmail.com](mailto:jtr...@gmail.com) wrote:

> I hear you on "better." I'm still in the "what the....?" phase. I'm sure  
> curl will be preferred once I'm no longer working with heavy web examples.
> 
> That being said, how the heck do I get this to work correctly? I'm not  
> sure how to provide parameters for "playground testing" via the \_analyze  
> API.
> 
> localhost:9200/\_analyze?tokenizer=edgeNGram&min\_gram=1&max\_gram=20&text=something
> 
> On Monday, January 14, 2013 1:42:42 PM UTC-5, David Pilato wrote:
> 
> > Better is a matter of point of view.  
> > What I love with curl commands is that it allows to create full curl  
> > recreation scripts when you need help.  
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/help)
> > 
> > See for exemple: [Test case for multifield fields · GitHub](https://gist.github.com/2965777)
> > 
> > That said, Head is a very cool interface to play with ES! 😉
> > 
> > --  
> > David 😉  
> > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > 
> > Le 14 janv. 2013 à 19:26, [jtr...@gmail.com](mailto:jtr...@gmail.com) a écrit :
> > 
> > Excellent. That works very well. This is much better than CURL or having  
> > a gigantic JSON packet in the URL bar.
> > 
> > Thanks!
> > 
> > On Monday, January 14, 2013 12:26:29 PM UTC-5, [jtr...@gmail.com](mailto:jtr...@gmail.com) wrote:
> > 
> > > Hi!
> > > 
> > > I have Elasticsearch running in my linux VM to test drive this  
> > > alternative to SOLR. I'd really prefer just to use a REST "tester" client  
> > > such as Poster for FireFox rather than retyping examples into curl or the  
> > > annoying issues with copy/paste into bash shell. I've tried most of the  
> > > other addins and none of them support sending body with a GET. They only  
> > > seem to allow payload for PUT and POST.
> > > 
> > > What do you use other than Curl available as a browser extension or  
> > > windows software?
> > > 
> > > --

--

---

<div class="post-metadata">

**Author:** ![Justin\_Treher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/justin_treher/32/45243_2.png) [@Justin\_Treher](https://discuss.elastic.co/u/Justin_Treher)\
**Post date:** [January 15, 2013, 2:12pm UTC](https://discuss.elastic.co/t/newbies-testing-out-elasticsearch-alternative-to-curl/10333/8 "2013-01-15T14:12:00Z")

</div>

Setting up a custom analyzer first worked great. The most confusing part of  
this for me is certainly the idea of creating everything from scratch for  
every change. With Solr, I just tweak an XML and issue a reload. Do you  
guys keep standard config JSON in a custom file that your application uses  
as needed to rebuild or modify?

On Monday, January 14, 2013 4:51:34 PM UTC-5, Zachary Tong wrote:

> I don't believe you can specify tokenizer settings directly through the  
> \_Analyze API. You could do:
> 
> curl -X GET "localhost:9200/\_analyze?tokenizer=edgeNGram" -d "this is  
> example text"
> 
> ...but that will use the defaults for edgeNGram (min\_gram = 1, etc). Or  
> you could use an custom analyzer which sets the appropriate settings. Note  
> that this query uses a test index, since analyzer mappings are per-index:
> 
> curl -X GET "localhost:9200/test/\_analyze?analyzer=analyzer\_edgeNGram" -d  
> "this is example text"
> 
> -Zach
> 
> On Monday, January 14, 2013 4:22:57 PM UTC-5, [jtr...@gmail.com](mailto:jtr...@gmail.com) wrote:
> 
> > I hear you on "better." I'm still in the "what the....?" phase. I'm sure  
> > curl will be preferred once I'm no longer working with heavy web examples.
> > 
> > That being said, how the heck do I get this to work correctly? I'm not  
> > sure how to provide parameters for "playground testing" via the \_analyze  
> > API.
> > 
> > localhost:9200/\_analyze?tokenizer=edgeNGram&min\_gram=1&max\_gram=20&text=something
> > 
> > On Monday, January 14, 2013 1:42:42 PM UTC-5, David Pilato wrote:
> > 
> > > Better is a matter of point of view.  
> > > What I love with curl commands is that it allows to create full curl  
> > > recreation scripts when you need help.  
> > > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/help)
> > > 
> > > See for exemple: [Test case for multifield fields · GitHub](https://gist.github.com/2965777)
> > > 
> > > That said, Head is a very cool interface to play with ES! 😉
> > > 
> > > --  
> > > David 😉  
> > > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > > 
> > > Le 14 janv. 2013 à 19:26, [jtr...@gmail.com](mailto:jtr...@gmail.com) a écrit :
> > > 
> > > Excellent. That works very well. This is much better than CURL or having  
> > > a gigantic JSON packet in the URL bar.
> > > 
> > > Thanks!
> > > 
> > > On Monday, January 14, 2013 12:26:29 PM UTC-5, [jtr...@gmail.com](mailto:jtr...@gmail.com) wrote:
> > > 
> > > > Hi!
> > > > 
> > > > I have Elasticsearch running in my linux VM to test drive this  
> > > > alternative to SOLR. I'd really prefer just to use a REST "tester" client  
> > > > such as Poster for FireFox rather than retyping examples into curl or the  
> > > > annoying issues with copy/paste into bash shell. I've tried most of the  
> > > > other addins and none of them support sending body with a GET. They only  
> > > > seem to allow payload for PUT and POST.
> > > > 
> > > > What do you use other than Curl available as a browser extension or  
> > > > windows software?
> > > > 
> > > > --

--

---

<div class="post-metadata">

**Author:** ![polyfractal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/polyfractal/32/48162_2.png) [@polyfractal](https://discuss.elastic.co/u/polyfractal)\
**Post date:** [January 15, 2013, 5:27pm UTC](https://discuss.elastic.co/t/newbies-testing-out-elasticsearch-alternative-to-curl/10333/9 "2013-01-15T17:27:40Z")

</div>

You can use the Template API[http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html?](http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html?)to manage a file-based template which is applied to new indicies matching  
certain patterns. Handy for programatically creating indices such as  
daily log indices.

-Z

On Tuesday, January 15, 2013 9:12:00 AM UTC-5, [jtr...@gmail.com](mailto:jtr...@gmail.com) wrote:

> Setting up a custom analyzer first worked great. The most confusing part  
> of this for me is certainly the idea of creating everything from scratch  
> for every change. With Solr, I just tweak an XML and issue a reload. Do you  
> guys keep standard config JSON in a custom file that your application uses  
> as needed to rebuild or modify?
> 
> On Monday, January 14, 2013 4:51:34 PM UTC-5, Zachary Tong wrote:
> 
> > I don't believe you can specify tokenizer settings directly through the  
> > \_Analyze API. You could do:
> > 
> > curl -X GET "localhost:9200/\_analyze?tokenizer=edgeNGram" -d "this is  
> > example text"
> > 
> > ...but that will use the defaults for edgeNGram (min\_gram = 1, etc). Or  
> > you could use an custom analyzer which sets the appropriate settings. Note  
> > that this query uses a test index, since analyzer mappings are per-index:
> > 
> > curl -X GET "localhost:9200/test/\_analyze?analyzer=analyzer\_edgeNGram" -d  
> > "this is example text"
> > 
> > -Zach
> > 
> > On Monday, January 14, 2013 4:22:57 PM UTC-5, [jtr...@gmail.com](mailto:jtr...@gmail.com) wrote:
> > 
> > > I hear you on "better." I'm still in the "what the....?" phase. I'm sure  
> > > curl will be preferred once I'm no longer working with heavy web examples.
> > > 
> > > That being said, how the heck do I get this to work correctly? I'm not  
> > > sure how to provide parameters for "playground testing" via the \_analyze  
> > > API.
> > > 
> > > localhost:9200/\_analyze?tokenizer=edgeNGram&min\_gram=1&max\_gram=20&text=something
> > > 
> > > On Monday, January 14, 2013 1:42:42 PM UTC-5, David Pilato wrote:
> > > 
> > > > Better is a matter of point of view.  
> > > > What I love with curl commands is that it allows to create full curl  
> > > > recreation scripts when you need help.  
> > > > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/help)
> > > > 
> > > > See for exemple: [Test case for multifield fields · GitHub](https://gist.github.com/2965777)
> > > > 
> > > > That said, Head is a very cool interface to play with ES! 😉
> > > > 
> > > > --  
> > > > David 😉  
> > > > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > > > 
> > > > Le 14 janv. 2013 à 19:26, [jtr...@gmail.com](mailto:jtr...@gmail.com) a écrit :
> > > > 
> > > > Excellent. That works very well. This is much better than CURL or  
> > > > having a gigantic JSON packet in the URL bar.
> > > > 
> > > > Thanks!
> > > > 
> > > > On Monday, January 14, 2013 12:26:29 PM UTC-5, [jtr...@gmail.com](mailto:jtr...@gmail.com) wrote:
> > > > 
> > > > > Hi!
> > > > > 
> > > > > I have Elasticsearch running in my linux VM to test drive this  
> > > > > alternative to SOLR. I'd really prefer just to use a REST "tester" client  
> > > > > such as Poster for FireFox rather than retyping examples into curl or the  
> > > > > annoying issues with copy/paste into bash shell. I've tried most of the  
> > > > > other addins and none of them support sending body with a GET. They only  
> > > > > seem to allow payload for PUT and POST.
> > > > > 
> > > > > What do you use other than Curl available as a browser extension or  
> > > > > windows software?
> > > > > 
> > > > > --

--

---

<div class="post-metadata">

**Author:** ![phill](https://avatars.discourse-cdn.com/v4/letter/p/779978/32.png) [@phill](https://discuss.elastic.co/u/phill)\
**Post date:** [January 30, 2013, 1:45am UTC](https://discuss.elastic.co/t/newbies-testing-out-elasticsearch-alternative-to-curl/10333/10 "2013-01-30T01:45:12Z")

</div>

As a windows user I went through the same thing, but finally decided  
that the right thing to do was to leverage all the Linux knowledge out  
there.

(1) install cygwin with curl and various other networking parts (I just  
picked a generous set of extra category installs since I had plenty of  
disk space). It sounds as if you have this since you said bash shell.

(2) write trivial shell scripts that contain nearly nothing but curl  
commands. Since I was writing these in my IDE and smart editors of  
choice and was learning, I certainly didn't want to throw anything away,  
so I was not doing any cut and paste of examples except into editors.

(3) run the shell scripts from the cygwin command window. Not by cut  
and paste, but by navigating to where ever I keep them in my source tree  
and picking one.

I also use head exploring search queries very often, but I generally use  
scripts + cygwin for various other things like index create/configure  
commands. Most of the search queries I end up pasting from a toString()  
in my IDE, pasting into head|Any Request, trying, editing it, trying  
again and again and again to understand what is going on, so I don't  
find it handy to scroll back through many experiments to find the index  
delete then scroll back again to find the index create command.

-Paul

On 1/14/2013 9:26 AM, [jtreher@gmail.com](mailto:jtreher@gmail.com) wrote:

> Hi!
> 
> I have Elasticsearch running in my linux VM to test drive this  
> alternative to SOLR. I'd really prefer just to use a REST "tester"  
> client such as Poster for FireFox rather than retyping examples into  
> curl or the annoying issues with copy/paste into bash shell. I've  
> tried most of the other addins and none of them support sending body  
> with a GET. They only seem to allow payload for PUT and POST.
> 
> What do you use other than Curl available as a browser extension or  
> windows software?

--  
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+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 2:54am UTC](https://discuss.elastic.co/t/newbies-testing-out-elasticsearch-alternative-to-curl/10333/11 "2017-07-06T02:54:05Z")

</div>


