# Different Path for each Index

**URL:** <https://discuss.elastic.co/t/different-path-for-each-index/125926>\
**Category:** Elasticsearch\
**Created:** [March 28, 2018, 11:50am UTC](https://discuss.elastic.co/t/different-path-for-each-index/125926 "2018-03-28T11:50:20Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![amitmjadav](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@amitmjadav](https://discuss.elastic.co/u/amitmjadav)\
**Post date:** [March 28, 2018, 11:50am UTC](https://discuss.elastic.co/t/different-path-for-each-index/125926/1 "2018-03-28T11:50:21Z")

</div>

Hi,

Can any one help me... I want different path while creating Index... Is it possible to give path in API ???

---

<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:** [March 28, 2018, 12:57pm UTC](https://discuss.elastic.co/t/different-path-for-each-index/125926/2 "2018-03-28T12:57:05Z")

</div>

No. Not really. A data path is a Node Level settings.

You can though decide on which nodes you can allocate the index shards but that's not exactly what you want.

Now the question is: what problem you want to solve here? I might have better solution if I understand the context.

---

<div class="post-metadata">

**Author:** ![amitmjadav](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@amitmjadav](https://discuss.elastic.co/u/amitmjadav)\
**Post date:** [March 28, 2018, 1:41pm UTC](https://discuss.elastic.co/t/different-path-for-each-index/125926/3 "2018-03-28T13:41:28Z")

</div>

Hi,

Thanks for the fast reply.

Now, Actually I have 1000 of documents which I want to Index. But not on the same path as defined in path.data directives in elasticsearch.yml file. What I want is 100 document on one path. another 100 on different path and so on..... So Is there any possibility that i can set path at Index level i.e While creating Index for each document. Please guide me.

I am using ES 5.4.3

Hope you got my point..

---

<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:** [March 28, 2018, 2:10pm UTC](https://discuss.elastic.co/t/different-path-for-each-index/125926/4 "2018-03-28T14:10:02Z")

</div>

> But not on the same path as defined in path.data directives in elasticsearch.yml file.

Why do you need that is the question? It does not really make sense in the context of distributed data. What is the problem you think you will be solving by using such a thing?

Anyway, may be you are confused by indices and paths.  
May be you want to separate documents let's say per client.

Elasticsearch is multi-tenant which means that you can do:

```auto
PUT client1/doc/1
{
 "foo": "bar1"
}
PUT client2/doc/1
{
 "foo": "bar2"
}

```

Then you can search in:

```auto
GET client1/_search
# Or
GET client2/_search
# Or
GET client1,client2/_search

```

Is that what you are looking for?

But the location of the data on disk should not be a concern. It's transparent.

---

<div class="post-metadata">

**Author:** ![amitmjadav](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@amitmjadav](https://discuss.elastic.co/u/amitmjadav)\
**Post date:** [March 29, 2018, 3:02am UTC](https://discuss.elastic.co/t/different-path-for-each-index/125926/5 "2018-03-29T03:02:43Z")

</div>

Hello David,

First of all If I am confusing you then very sorry .. but Its my Production Environment requirement that while doing indexing, we can decide the path on which node it is allotted .....Though It is clustered environment ....  
So Is there any way we can declare path for each node separately in index API ??

Further,  
Is there any way to give encrypted password while Indexing/Querying ??

Currently with x-pack security I am doing like  
curl -XGET -u username:password [http://Server:9200/\_cluster/health?pretty](http://Server:9200/_cluster/health?pretty)

So instead of giving password naked, Is there any way to give it in encrypted form...

Hope you got me....

Thanks...

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [March 29, 2018, 4:51am UTC](https://discuss.elastic.co/t/different-path-for-each-index/125926/6 "2018-03-29T04:51:00Z")

</div>

> [@amitmjadav](#):
>
> So Is there any way we can declare path for each node separately in index API ??

No. Why is that a requirement, what purpose does it serve?

> [@amitmjadav](#):
>
> Is there any way to give encrypted password while Indexing/Querying ??

What clients are you using to interact with Elasticsearch?

---

<div class="post-metadata">

**Author:** ![amitmjadav](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@amitmjadav](https://discuss.elastic.co/u/amitmjadav)\
**Post date:** [March 29, 2018, 6:49am UTC](https://discuss.elastic.co/t/different-path-for-each-index/125926/7 "2018-03-29T06:49:28Z")

</div>

C# and NEST

---

<div class="post-metadata">

**Author:** ![amitmjadav](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@amitmjadav](https://discuss.elastic.co/u/amitmjadav)\
**Post date:** [March 29, 2018, 7:37am UTC](https://discuss.elastic.co/t/different-path-for-each-index/125926/8 "2018-03-29T07:37:32Z")

</div>

Hello,

Consider the following Scenario...

If I am doing indexing with 5 different users i.e a,b,c,d,e....  
So if I do indexing using user a it will put data(shards) in a folder  
If indexing using user b it will put data in b folder  
and so on.....

Is this possible using API ??

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [March 29, 2018, 9:04am UTC](https://discuss.elastic.co/t/different-path-for-each-index/125926/9 "2018-03-29T09:04:52Z")

</div>

It's not possible unless you spin up different clusters.

But, again, what are you trying to solve with this?

---

<div class="post-metadata">

**Author:** ![amitmjadav](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@amitmjadav](https://discuss.elastic.co/u/amitmjadav)\
**Post date:** [March 29, 2018, 9:30am UTC](https://discuss.elastic.co/t/different-path-for-each-index/125926/10 "2018-03-29T09:30:40Z")

</div>

Means I have to create different cluster for each and every user ???  
The basic idea behind this is to differentiate/Separate the indexes created by each user...

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [March 29, 2018, 9:41am UTC](https://discuss.elastic.co/t/different-path-for-each-index/125926/11 "2018-03-29T09:41:14Z")

</div>

So just create separate indices? It's still not clear why you cannot just use an index per user.

---

<div class="post-metadata">

**Author:** ![amitmjadav](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@amitmjadav](https://discuss.elastic.co/u/amitmjadav)\
**Post date:** [March 29, 2018, 12:36pm UTC](https://discuss.elastic.co/t/different-path-for-each-index/125926/12 "2018-03-29T12:36:10Z")

</div>

This is the requirement from my Production side .....  
All data goes in /var/lib/elasticsearch/nodes/0/indeces/........ while indexing a document ...by default

They want to give this path manually via API ....  
Is this possible ???

---

<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:** [March 29, 2018, 2:04pm UTC](https://discuss.elastic.co/t/different-path-for-each-index/125926/13 "2018-03-29T14:04:18Z")

</div>

No it's not.

And you are probably misunderstanding what elasticsearch is.

---

<div class="post-metadata">

**Author:** ![amitmjadav](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@amitmjadav](https://discuss.elastic.co/u/amitmjadav)\
**Post date:** [March 29, 2018, 2:35pm UTC](https://discuss.elastic.co/t/different-path-for-each-index/125926/14 "2018-03-29T14:35:09Z")

</div>

Ok.. Thanks David and Mark for your Valuable time...  
And Sorry for this misunderstanding......As I am new/beginner to ES....

---

<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:** [March 29, 2018, 2:48pm UTC](https://discuss.elastic.co/t/different-path-for-each-index/125926/15 "2018-03-29T14:48:00Z")

</div>

That's why we are asking the question about the needs and not the way you think you implement this.

Again, don't worry about the structure on disk. Elasticsearch is just accessible through the APIs.

---

<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:** [April 26, 2018, 2:48pm UTC](https://discuss.elastic.co/t/different-path-for-each-index/125926/16 "2018-04-26T14:48:16Z")

</div>

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