# Looking for my "ah ha!" moment

**URL:** <https://discuss.elastic.co/t/looking-for-my-ah-ha-moment/7999>\
**Category:** Elasticsearch\
**Created:** [June 6, 2012, 8:31pm UTC](https://discuss.elastic.co/t/looking-for-my-ah-ha-moment/7999 "2012-06-06T20:31:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Meltemi](https://avatars.discourse-cdn.com/v4/letter/m/a87d85/32.png) [@Meltemi](https://discuss.elastic.co/u/Meltemi)\
**Post date:** [June 6, 2012, 8:31pm UTC](https://discuss.elastic.co/t/looking-for-my-ah-ha-moment/7999/1 "2012-06-06T20:31:30Z")

</div>

I'm relatively new to search and definitely new to elasticsearch. Hoping  
someone can take a moment to give me a 10,000 ft. overview of ES. The  
[elasticsearch.org](http://elasticsearch.org) guides seem to jump right into details, forgoing basic  
concepts.

For example, I'd like to play around with elasticsearch and try indexing  
some PDFs, but it's not clear, to me, how (via REST interface) to create an  
index, index some docs into it, goof with search terms & results, and then  
destroy that entire index, leaving no trace of my fiddling.

Even less clear is how the REST URL is structured:

$ curl -XPUT [http://localhost:9200/twitter/user/kimchy](http://localhost:9200/twitter/user/kimchy) -d '{ "name" : "Shay  
Banon" }'

I take it the first segment of the path ('twitter') is the index name -  
defined on the fly? And the 2nd ('user') is some sub-classification. But  
how, where, is this defined/documented? etc.

Say I index some documents under the 'twitter' index, how then do I go  
about removing one of them? Or, the whole 'twitter' index and all of its  
contents without affecting any of the other indexes?

How to see a list of indexes so you know what _can_ be searched? I guess  
my background wants to treat this like a database where one can easily add  
& drop databases & tables. What's the analogy in ES's world?

Any help, or links, appreciated.

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [June 6, 2012, 9:34pm UTC](https://discuss.elastic.co/t/looking-for-my-ah-ha-moment/7999/2 "2012-06-06T21:34:30Z")

</div>

Answers inline.

On Wed, Jun 6, 2012 at 1:31 PM, Meltemi [mdemetrios@gmail.com](mailto:mdemetrios@gmail.com) wrote:

> $ curl -XPUT [http://localhost:9200/twitter/user/kimchy](http://localhost:9200/twitter/user/kimchy) -d '{ "name" : "Shay  
> Banon" }'
> 
> I take it the first segment of the path ('twitter') is the index name -  
> defined on the fly? And the 2nd ('user') is some sub-classification. But  
> how, where, is this defined/documented? etc.

The second classification, "user", is the type. An index can have  
several types. In this case, the index "twitter" is created and a  
document of type "user" with id "kimchy" is placed into the index. The  
majority of the time, you will be creating indices beforehand and then  
inserting documents in different steps).

> Say I index some documents under the 'twitter' index, how then do I go about  
> removing one of them?

Delete by Query

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

> Or, the whole 'twitter' index and all of its contents without affecting any of the other indexes?

Delete Index

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

> How to see a list of indexes so you know what can be searched? I guess my  
> background wants to treat this like a database where one can easily add &  
> drop databases & tables. What's the analogy in ES's world?

That would require looking into the cluster state:

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

Hope this helps,

Ivan

---

<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:** [June 6, 2012, 9:55pm UTC](https://discuss.elastic.co/t/looking-for-my-ah-ha-moment/7999/3 "2012-06-06T21:55:38Z")

</div>

I would add to Ivan's answer that if you know the document ID, you can  
delete it with a simple DELETE :

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

BTW, ES is a Zero Conf product (when you start). That's the reason why ES  
can accept as your first curl call something like  
$ curl -XPUT [http://localhost:9200/twitter/user/kimchy](http://localhost:9200/twitter/user/kimchy) -d '{ "name" : "Shay  
Banon" }'

ES knows that he have to create a new index with default settings called  
twitter, that there is a new document type in this index called user. More  
than that, ES find out itself the mapping for your user type (field name as  
a String).

About PDF indexing, you should give a look at the attachment plugin :

> **[GitHub - elastic/elasticsearch-mapper-attachments: Mapper Attachments Type...](https://github.com/elastic/elasticsearch-mapper-attachments)**
>
> Mapper Attachments Type plugin for Elasticsearch. Contribute to elastic/elasticsearch-mapper-attachments development by creating an account on GitHub.

For basic information about ES, you can also have a look here :  
[http://www.slideshare.net/dadoonet/elasticsearch-devoxx-france-2012-english-](http://www.slideshare.net/dadoonet/elasticsearch-devoxx-france-2012-english-)  
version

HTH  
David.

> -----Message d'origine-----  
> De : [elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com)  
> [[mailto:elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com)] De la part de Ivan Brusic  
> Envoyé : mercredi 6 juin 2012 23:35  
> À : [elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com)  
> Objet : Re: Looking for my "ah ha!" moment
> 
> Answers inline.
> 
> On Wed, Jun 6, 2012 at 1:31 PM, Meltemi [mdemetrios@gmail.com](mailto:mdemetrios@gmail.com) wrote:
> 
> > $ curl -XPUT [http://localhost:9200/twitter/user/kimchy](http://localhost:9200/twitter/user/kimchy) -d '{ "name" :  
> > "Shay Banon" }'
> > 
> > I take it the first segment of the path ('twitter') is the index name
> > 
> > - defined on the fly? And the 2nd ('user') is some sub-  
> > classification.  
> > But how, where, is this defined/documented? etc.
> 
> The second classification, "user", is the type. An index can have  
> several types. In this case, the index "twitter" is created and a  
> document of type "user" with id "kimchy" is placed into the index. The  
> majority of the time, you will be creating indices beforehand and then  
> inserting documents in different steps).
> 
> > Say I index some documents under the 'twitter' index, how then do I  
> > go  
> > about removing one of them?
> 
> Delete by Query  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/delete-by-query.html)
> 
> > Or, the whole 'twitter' index and all of its contents without  
> > affecting any of the other indexes?
> 
> Delete Index  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-delete-)  
> index.html
> 
> > How to see a list of indexes so you know what can be searched? I  
> > guess my background wants to treat this like a database where one can  
> > easily add & drop databases & tables. What's the analogy in ES's  
> > world?
> 
> That would require looking into the cluster state:
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-cluster-)  
> state.html
> 
> Hope this helps,
> 
> Ivan

---

<div class="post-metadata">

**Author:** ![Shaun\_Etherton](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shaun_etherton/32/2540_2.png) [@Shaun\_Etherton](https://discuss.elastic.co/u/Shaun_Etherton)\
**Post date:** [June 7, 2012, 1:12pm UTC](https://discuss.elastic.co/t/looking-for-my-ah-ha-moment/7999/4 "2012-06-07T13:12:55Z")

</div>

Hi

I found this page helpful; i'm doing the same thing you are with PDF files.

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

This link at the bottom of the page has the full script you can use to get  
going & quickly experiment.

> <https://gist.github.com/lukas-vlcek/1075067>

Changing the number of shards and replicas and using the elasticsearch-head  
plugin was also very helpful.

> **[GitHub - mobz/elasticsearch-head: A web front end for an elastic search cluster](https://github.com/mobz/elasticsearch-head)**
>
> A web front end for an elastic search cluster. Contribute to mobz/elasticsearch-head development by creating an account on GitHub.

HTH.  
cheers

- shaun

On Thursday, June 7, 2012 6:01:30 AM UTC+9:30, Meltemi wrote:

> I'm relatively new to search and definitely new to elasticsearch. Hoping  
> someone can take a moment to give me a 10,000 ft. overview of ES. The  
> [elasticsearch.org](http://elasticsearch.org) guides seem to jump right into details, forgoing basic  
> concepts.
> 
> For example, I'd like to play around with elasticsearch and try indexing  
> some PDFs, but it's not clear, to me, how (via REST interface) to create an  
> index, index some docs into it, goof with search terms & results, and then  
> destroy that entire index, leaving no trace of my fiddling.
> 
> Even less clear is how the REST URL is structured:
> 
> $ curl -XPUT [http://localhost:9200/twitter/user/kimchy](http://localhost:9200/twitter/user/kimchy) -d '{ "name" :  
> "Shay Banon" }'
> 
> I take it the first segment of the path ('twitter') is the index name -  
> defined on the fly? And the 2nd ('user') is some sub-classification. But  
> how, where, is this defined/documented? etc.
> 
> Say I index some documents under the 'twitter' index, how then do I go  
> about removing one of them? Or, the whole 'twitter' index and all of its  
> contents without affecting any of the other indexes?
> 
> How to see a list of indexes so you know what _can_ be searched? I guess  
> my background wants to treat this like a database where one can easily add  
> & drop databases & tables. What's the analogy in ES's world?
> 
> Any help, or links, appreciated.

On Thursday, June 7, 2012 6:01:30 AM UTC+9:30, Meltemi wrote:

> I'm relatively new to search and definitely new to elasticsearch. Hoping  
> someone can take a moment to give me a 10,000 ft. overview of ES. The  
> [elasticsearch.org](http://elasticsearch.org) guides seem to jump right into details, forgoing basic  
> concepts.
> 
> For example, I'd like to play around with elasticsearch and try indexing  
> some PDFs, but it's not clear, to me, how (via REST interface) to create an  
> index, index some docs into it, goof with search terms & results, and then  
> destroy that entire index, leaving no trace of my fiddling.
> 
> Even less clear is how the REST URL is structured:
> 
> $ curl -XPUT [http://localhost:9200/twitter/user/kimchy](http://localhost:9200/twitter/user/kimchy) -d '{ "name" :  
> "Shay Banon" }'
> 
> I take it the first segment of the path ('twitter') is the index name -  
> defined on the fly? And the 2nd ('user') is some sub-classification. But  
> how, where, is this defined/documented? etc.
> 
> Say I index some documents under the 'twitter' index, how then do I go  
> about removing one of them? Or, the whole 'twitter' index and all of its  
> contents without affecting any of the other indexes?
> 
> How to see a list of indexes so you know what _can_ be searched? I guess  
> my background wants to treat this like a database where one can easily add  
> & drop databases & tables. What's the analogy in ES's world?
> 
> Any help, or links, appreciated.

---

<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, 3:25am UTC](https://discuss.elastic.co/t/looking-for-my-ah-ha-moment/7999/5 "2017-07-06T03:25:22Z")

</div>


