# Generic question

**URL:** <https://discuss.elastic.co/t/generic-question/8070>\
**Category:** Elasticsearch\
**Created:** [June 13, 2012, 5:38am UTC](https://discuss.elastic.co/t/generic-question/8070 "2012-06-13T05:38:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajan](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@ajan](https://discuss.elastic.co/u/ajan)\
**Post date:** [June 13, 2012, 5:38am UTC](https://discuss.elastic.co/t/generic-question/8070/1 "2012-06-13T05:38:51Z")

</div>

I have resources that I need to index, they look like the below, I  
index this into index "managedobject" and type as "host" using ../  
managedobject/host

{  
"xmlns:base":"[http://ontologies.domain.com//base/2009/08/base](http://ontologies.domain.com//base/2009/08/base)",  
"xmlns:host":"[http://ontologies.domain.com//base/2009/08/host](http://ontologies.domain.com//base/2009/08/host)",  
"base:DisplayName":"Host-960a8b54ecb34475a3d9b508738cc1fa",  
"base:LastUpdated":1335366724956,  
"base:LastUpdatedDateTime":"2012-04-25T11:12:04.956-0400",  
"base:Model":"PowerEdge 1565",  
"base:Name":"[Host-960a8b54ecb34475a3d9b508738cc1fa.lss.domain.com](http://Host-960a8b54ecb34475a3d9b508738cc1fa.lss.domain.com)",  
"base:Identifier":"tag:@domain.com,  
2011:host:Host::Host-960a8b54ecb34475a3d9b508738cc1fa",  
"base:Identifier":"Host-960a8b54ecb34475a3d9b508738cc1fa",  
"base:Identifier":"[Host-960a8b54ecb34475a3d9b508738cc1fa.lss.domain.com](http://Host-960a8b54ecb34475a3d9b508738cc1fa.lss.domain.com)",  
"base:Identifier":"10.226.214.73",  
"base:Status":"OK",  
"base:Vendor":"Dell Inc.",  
"base:discoveryStatus":"Success",  
"host:CPUSpeed":"0.29 Ghz",  
"host:CPUType":"Intel(R) Xeon(R) CPU E5410 @ 2.33GHz",  
"host:CreatedBy":"Discovery",  
"host:FQDN":"[Host-960a8b54ecb34475a3d9b508738cc1fa.lss.domain.com](http://Host-960a8b54ecb34475a3d9b508738cc1fa.lss.domain.com)",  
"host:MultipathVersion":"4.7",  
"host:NumberOfCPUs":"4 x 1.08 Ghz Intel(R) Xeon(R) CPU E5410 @  
2.33GHz",  
"host:OperatingSystemVersion":"4.7",  
"host:PhysicalMemorySize":"304798513",  
"host:ShortName":"Host-960a8b54ecb34475a3d9b508738cc1fa",  
"host:VersionSolutionEnabler":"7.7"  
}

My question is, to get a best performance do I keep the document  
structure the same or make some change to this representation?

---

<div class="post-metadata">

**Author:** ![Nick\_Dunn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nick_dunn/32/2315_2.png) [@Nick\_Dunn](https://discuss.elastic.co/u/Nick_Dunn)\
**Post date:** [June 13, 2012, 7:18am UTC](https://discuss.elastic.co/t/generic-question/8070/2 "2012-06-13T07:18:35Z")

</div>

It depends on how you want to query this data later.

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [June 13, 2012, 10:27am UTC](https://discuss.elastic.co/t/generic-question/8070/3 "2012-06-13T10:27:08Z")

</div>

> "[base:Identifier":"tag:@domain.com](mailto:base:Identifier%22:%22tag:@domain.com),  
> 2011:host:Host::Host-960a8b54ecb34475a3d9b508738cc1fa",  
> "base:Identifier":"Host-960a8b54ecb34475a3d9b508738cc1fa",  
> "base:Identifier":"[Host-960a8b54ecb34475a3d9b508738cc1fa.lss.domain.com](http://Host-960a8b54ecb34475a3d9b508738cc1fa.lss.domain.com)",

> My question is, to get a best performance do I keep the document  
> structure the same or make some change to this representation?

Also, the above is not legal JSON, as you cannot repeat key names.  
Elasticsearch will actually index the above just fine, but if you are  
retrieving this \_source docs from Elasticsearch, there is a good chance  
that any JSON module that you use will accept only the last value for a  
repeated key.

---

<div class="post-metadata">

**Author:** ![ajan](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@ajan](https://discuss.elastic.co/u/ajan)\
**Post date:** [June 13, 2012, 10:59am UTC](https://discuss.elastic.co/t/generic-question/8070/4 "2012-06-13T10:59:56Z")

</div>

Will a search on any of these Identifer return the same document? If  
it does not then I will need to make changes to this document.

On Jun 13, 3:27 pm, Clinton Gormley [cl...@traveljury.com](mailto:cl...@traveljury.com) wrote:

> > "[base:Identifier":"tag:@domain.com](mailto:base:Identifier%22:%22tag:@domain.com),  
> > 2011:host:Host::Host-960a8b54ecb34475a3d9b508738cc1fa",  
> > "base:Identifier":"Host-960a8b54ecb34475a3d9b508738cc1fa",  
> > "base:Identifier":"[Host-960a8b54ecb34475a3d9b508738cc1fa.lss.domain.com](http://Host-960a8b54ecb34475a3d9b508738cc1fa.lss.domain.com)",  
> > My question is, to get a best performance do I keep the document  
> > structure the same or make some change to this representation?
> 
> Also, the above is not legal JSON, as you cannot repeat key names.  
> Elasticsearch will actually index the above just fine, but if you are  
> retrieving this \_source docs from Elasticsearch, there is a good chance  
> that any JSON module that you use will accept only the last value for a  
> repeated key.

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [June 13, 2012, 12:02pm UTC](https://discuss.elastic.co/t/generic-question/8070/5 "2012-06-13T12:02:13Z")

</div>

On Wed, 2012-06-13 at 03:59 -0700, ajan wrote:

> Will a search on any of these Identifer return the same document? If  
> it does not then I will need to make changes to this document.

It will return exactly what you sent it. So if your receiving code can  
handle illegal JSON, then you'll be fine

clint

> On Jun 13, 3:27 pm, Clinton Gormley [cl...@traveljury.com](mailto:cl...@traveljury.com) wrote:
> 
> > > "[base:Identifier":"tag:@domain.com](mailto:base:Identifier%22:%22tag:@domain.com),  
> > > 2011:host:Host::Host-960a8b54ecb34475a3d9b508738cc1fa",  
> > > "base:Identifier":"Host-960a8b54ecb34475a3d9b508738cc1fa",  
> > > "base:Identifier":"[Host-960a8b54ecb34475a3d9b508738cc1fa.lss.domain.com](http://Host-960a8b54ecb34475a3d9b508738cc1fa.lss.domain.com)",  
> > > My question is, to get a best performance do I keep the document  
> > > structure the same or make some change to this representation?
> > 
> > Also, the above is not legal JSON, as you cannot repeat key names.  
> > Elasticsearch will actually index the above just fine, but if you are  
> > retrieving this \_source docs from Elasticsearch, there is a good chance  
> > that any JSON module that you use will accept only the last value for a  
> > repeated key.

---

<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:24am UTC](https://discuss.elastic.co/t/generic-question/8070/6 "2017-07-06T03:24:35Z")

</div>

Closed on July 6, 2017, 3:24am UTC


