# Direct index mapping vs index mapping with directory

**URL:** <https://discuss.elastic.co/t/direct-index-mapping-vs-index-mapping-with-directory/187979>\
**Category:** Elasticsearch\
**Created:** [June 28, 2019, 7:01am UTC](https://discuss.elastic.co/t/direct-index-mapping-vs-index-mapping-with-directory/187979 "2019-06-28T07:01:02Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![manish\_kaushik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/manish_kaushik/32/48169_2.png) [@manish\_kaushik](https://discuss.elastic.co/u/manish_kaushik)\
**Post date:** [June 28, 2019, 7:01am UTC](https://discuss.elastic.co/t/direct-index-mapping-vs-index-mapping-with-directory/187979/1 "2019-06-28T07:01:02Z")

</div>

hey, I am unable to understand the difference between indexing data directly by making an index and by making particulars in an index.  
ex:- how I create index from mysql to elastic via logstash is by providing index and all the data is in that index.  
but I have seen a lot of place they work like marvel/movies/1/\_search. What is the difference between these and which is more efficient if they are different. Also, How can i achieve this via logstash? @DavidTurner @ikakavas @dadoonet @theuntergeek

---

<div class="post-metadata">

**Author:** ![ikakavas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ikakavas/32/34430_2.png) [@ikakavas](https://discuss.elastic.co/u/ikakavas)\
**Post date:** [June 28, 2019, 7:08am UTC](https://discuss.elastic.co/t/direct-index-mapping-vs-index-mapping-with-directory/187979/2 "2019-06-28T07:08:14Z")

</div>

Hi @manish_kaushik ! Please refrain from pinging/addressing people directly. This is a public forum and questions are answered by whoever has the time to put in the effort to do so. We monitor these forums and will provide answers to the best of our ability and availability.

---

<div class="post-metadata">

**Author:** ![manish\_kaushik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/manish_kaushik/32/48169_2.png) [@manish\_kaushik](https://discuss.elastic.co/u/manish_kaushik)\
**Post date:** [June 28, 2019, 7:09am UTC](https://discuss.elastic.co/t/direct-index-mapping-vs-index-mapping-with-directory/187979/3 "2019-06-28T07:09:07Z")

</div>

Sure

---

<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 28, 2019, 8:15am UTC](https://discuss.elastic.co/t/direct-index-mapping-vs-index-mapping-with-directory/187979/4 "2019-06-28T08:15:04Z")

</div>

I don't understand the question to be honest.

---

<div class="post-metadata">

**Author:** ![manish\_kaushik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/manish_kaushik/32/48169_2.png) [@manish\_kaushik](https://discuss.elastic.co/u/manish_kaushik)\
**Post date:** [June 28, 2019, 8:38am UTC](https://discuss.elastic.co/t/direct-index-mapping-vs-index-mapping-with-directory/187979/5 "2019-06-28T08:38:21Z")

</div>

okay, So, I am indexing like this:  
elasticsearch {  
hosts =\> ["localhost:9200"]  
action=\>update  
# "%{id}" - \> primary key of the table  
document\_id =\> "%{id}"  
index =\>"books"  
doc\_as\_upsert =\>true

Now, I have seen some posts they have proper id's of every document like this:  
[http://localhost:9200/vehicles/car/\_search](http://localhost:9200/vehicles/car/_search)

[http://localhost:9200/vehicles/bike/\_search](http://localhost:9200/vehicles/bike/_search)

they are using specified words like bike and car for indexing while i am just indexing in vehicles.  
thats what i am unable to understand and am i properly indexing my data?

---

<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 28, 2019, 11:28am UTC](https://discuss.elastic.co/t/direct-index-mapping-vs-index-mapping-with-directory/187979/6 "2019-06-28T11:28:17Z")

</div>

Sorry. I'm still not getting it.

Could you provide a full recreation script as described in [About the Elasticsearch category](https://discuss.elastic.co/t/about-the-elasticsearch-category/21). It will help to better understand what you are doing. Please, try to keep the example as simple as possible.

A full reproduction script will help readers to understand, reproduce and if needed fix your problem. It will also most likely help to get a faster answer.

Otherwise may be someone else will be able to answer.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [June 28, 2019, 1:09pm UTC](https://discuss.elastic.co/t/direct-index-mapping-vs-index-mapping-with-directory/187979/7 "2019-06-28T13:09:25Z")

</div>

Those are types within an index, which is a concept that is being deprecated.

---

<div class="post-metadata">

**Author:** ![manish\_kaushik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/manish_kaushik/32/48169_2.png) [@manish\_kaushik](https://discuss.elastic.co/u/manish_kaushik)\
**Post date:** [June 28, 2019, 1:13pm UTC](https://discuss.elastic.co/t/direct-index-mapping-vs-index-mapping-with-directory/187979/8 "2019-06-28T13:13:51Z")

</div>

Thanks

---

<div class="post-metadata">

**Author:** ![manish\_kaushik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/manish_kaushik/32/48169_2.png) [@manish\_kaushik](https://discuss.elastic.co/u/manish_kaushik)\
**Post date:** [June 28, 2019, 1:14pm UTC](https://discuss.elastic.co/t/direct-index-mapping-vs-index-mapping-with-directory/187979/9 "2019-06-28T13:14:08Z")

</div>

thanks dadonet

---

<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 26, 2019, 1:14pm UTC](https://discuss.elastic.co/t/direct-index-mapping-vs-index-mapping-with-directory/187979/10 "2019-07-26T13:14:18Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
