# There are some kind of multiple unique elastic search index?

**URL:** <https://discuss.elastic.co/t/there-are-some-kind-of-multiple-unique-elastic-search-index/107176>\
**Category:** Elasticsearch\
**Created:** [November 10, 2017, 12:03pm UTC](https://discuss.elastic.co/t/there-are-some-kind-of-multiple-unique-elastic-search-index/107176 "2017-11-10T12:03:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![silvia](https://avatars.discourse-cdn.com/v4/letter/s/8797f3/32.png) [@silvia](https://discuss.elastic.co/u/silvia)\
**Post date:** [November 10, 2017, 12:03pm UTC](https://discuss.elastic.co/t/there-are-some-kind-of-multiple-unique-elastic-search-index/107176/1 "2017-11-10T12:03:07Z")

</div>

Hi All,

I am new in Elastic Search and

I want to use different fields like unique id.

For example:

I have a data elastic search document as follows :

\</\>@Document(indexName = "outlet")  
public class MyIndex implements IESMapper{

```
@Id
private String name;
private Long Id;
private Type type;
private String address;
private String geoLocation;
private String city;

// getter and setter methods

```

}\</\>

Is it possible Id, address, and geoLocation be unique indexes in the Elastic Search database?

I hope be clear,

Thanks a lot for some help

Silvia

---

<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:** [November 10, 2017, 4:31pm UTC](https://discuss.elastic.co/t/there-are-some-kind-of-multiple-unique-elastic-search-index/107176/2 "2017-11-10T16:31:54Z")

</div>

The only field that is unique within an index is the id of the document. You can create a custom id based on several other fields, which would be unique, but there is no way to force any other indexed fields to be unique.

---

<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:** [December 8, 2017, 4:32pm UTC](https://discuss.elastic.co/t/there-are-some-kind-of-multiple-unique-elastic-search-index/107176/3 "2017-12-08T16:32:13Z")

</div>

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