# Basic Query question

**URL:** <https://discuss.elastic.co/t/basic-query-question/7746>\
**Category:** Elasticsearch\
**Created:** [May 17, 2012, 5:08pm UTC](https://discuss.elastic.co/t/basic-query-question/7746 "2012-05-17T17:08:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mohit\_Anchlia](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@Mohit\_Anchlia](https://discuss.elastic.co/u/Mohit_Anchlia)\
**Post date:** [May 17, 2012, 5:08pm UTC](https://discuss.elastic.co/t/basic-query-question/7746/1 "2012-05-17T17:08:31Z")

</div>

I convert xml to json and it looks like as pasted below. My question :

1. How can user search for values where "id = USIndividual" and "field.id  
= DaytimePhoneNumber \<field.@id%20=%20DaytimePhoneNumber\>"
2. Map.id=1040 and field.id = DaytimePhoneNumber

Is the above possible or should I do something differenly. I need to  
understand how the queries would work for below Json.

"MapML" : {  
"@xmlns" : "[http://schemas.intuit.com/cg/services/filing](http://schemas.intuit.com/cg/services/filing)",  
"@xmlns:xsi" : "[http://www.w3.org/2001/XMLSchema-instance](http://www.w3.org/2001/XMLSchema-instance)",  
"@serviceImplementationVersion" : "TPS.2011.003.09.main.042804",  
"@xsi:schemaLocation" :  
"[http://schemas.intuit.com/cg/services/filingMapML.xsd](http://schemas.intuit.com/cg/services/filingMapML.xsd)",  
"@compatibilityVersion" : "CVTY11v10600",  
"Mapset" : {  
"@xmlns" : "[http://schemas.intuit.com/cg/services/filing](http://schemas.intuit.com/cg/services/filing)",  
"@xmlns:xsi" : "[http://www.w3.org/2001/XMLSchema-instance](http://www.w3.org/2001/XMLSchema-instance)",  
"@id" : "USIndividual",  
"@interfaceVersion" : "CVTY11v10300",  
"@implementationVersion" : "2011.2.0.0-SNAPSHOT",  
"Map" : {  
"@id" : "1040",  
"field" : {  
"@id" : "DaytimePhoneNumber",  
"@status" : "mapped ",  
"@tpsid" : "DTPHO",  
"@xsi:type" : "Phone",  
"value" : {  
"@source" : "computed",  
"$" : "7777777777"  
}  
}  
}  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![Mohit\_Anchlia](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@Mohit\_Anchlia](https://discuss.elastic.co/u/Mohit_Anchlia)\
**Post date:** [May 18, 2012, 5:11pm UTC](https://discuss.elastic.co/t/basic-query-question/7746/2 "2012-05-18T17:11:30Z")

</div>

Please help. I am currently working on designing the json schema so  
understanding this would be really helpful.

On Thu, May 17, 2012 at 10:08 AM, Mohit Anchlia [mohitanchlia@gmail.com](mailto:mohitanchlia@gmail.com)wrote:

> I convert xml to json and it looks like as pasted below. My question :
> 
> 1. How can user search for values where "id = USIndividual" and "field.id  
> = DaytimePhoneNumber \<field.@id%20=%20DaytimePhoneNumber\>"
> 2. Map.id=1040 and field.id = DaytimePhoneNumber
> 
> Is the above possible or should I do something differenly. I need to  
> understand how the queries would work for below Json.
> 
> "MapML" : {  
> "@xmlns" : "[http://schemas.intuit.com/cg/services/filing](http://schemas.intuit.com/cg/services/filing)",  
> "@xmlns:xsi" : "[http://www.w3.org/2001/XMLSchema-instance](http://www.w3.org/2001/XMLSchema-instance)",  
> "@serviceImplementationVersion" : "TPS.2011.003.09.main.042804",  
> "@xsi:schemaLocation" : "[http://schemas.intuit.com/cg/services/filingMapML.xsd](http://schemas.intuit.com/cg/services/filingMapML.xsd)",  
> "@compatibilityVersion" : "CVTY11v10600",  
> "Mapset" : {  
> "@xmlns" : "[http://schemas.intuit.com/cg/services/filing](http://schemas.intuit.com/cg/services/filing)",  
> "@xmlns:xsi" : "[http://www.w3.org/2001/XMLSchema-instance](http://www.w3.org/2001/XMLSchema-instance)",  
> "@id" : "USIndividual",  
> "@interfaceVersion" : "CVTY11v10300",  
> "@implementationVersion" : "2011.2.0.0-SNAPSHOT",  
> "Map" : {  
> "@id" : "1040",  
> "field" : {  
> "@id" : "DaytimePhoneNumber",  
> "@status" : "mapped ",  
> "@tpsid" : "DTPHO",  
> "@xsi:type" : "Phone",  
> "value" : {  
> "@source" : "computed",  
> "$" : "7777777777"  
> }  
> }  
> }  
> }  
> }  
> }

---

<div class="post-metadata">

**Author:** ![Radu\_Gheorghe1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/radu_gheorghe1/32/2688_2.png) [@Radu\_Gheorghe1](https://discuss.elastic.co/u/Radu_Gheorghe1)\
**Post date:** [May 20, 2012, 12:47pm UTC](https://discuss.elastic.co/t/basic-query-question/7746/3 "2012-05-20T12:47:25Z")

</div>

I think you have to define nested types:

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

and run nested queries:

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

I'm not sure exactly how to do it (other than what the Guide  
describes) because I've never done it myself.

But please come back if you can't make it work after reading the docs.  
I could give it a try, or maybe someone less newbie than me would hop  
in and give you advice.

On 18 mai, 20:11, Mohit Anchlia [mohitanch...@gmail.com](mailto:mohitanch...@gmail.com) wrote:

> Please help. I am currently working on designing the json schema so  
> understanding this would be really helpful.
> 
> On Thu, May 17, 2012 at 10:08 AM, Mohit Anchlia [mohitanch...@gmail.com](mailto:mohitanch...@gmail.com)wrote:
> 
> > I convert xml to json and it looks like as pasted below. My question :
> 
> > 1. How can user search for values where "id = USIndividual" and "field.id  
> > = DaytimePhoneNumber \<field.@id%20=%20DaytimePhoneNumber\>"
> > 2. Map.id=1040 and field.id = DaytimePhoneNumber
> 
> > Is the above possible or should I do something differenly. I need to  
> > understand how the queries would work for below Json.
> 
> > "MapML" : {  
> > "@xmlns" : "[http://schemas.intuit.com/cg/services/filing](http://schemas.intuit.com/cg/services/filing)",  
> > "@xmlns:xsi" : "[http://www.w3.org/2001/XMLSchema-instance](http://www.w3.org/2001/XMLSchema-instance)",  
> > "@serviceImplementationVersion" : "TPS.2011.003.09.main.042804",  
> > "@xsi:schemaLocation" : "[http://schemas.intuit.com/cg/services/filingMapML.xsd](http://schemas.intuit.com/cg/services/filingMapML.xsd)",  
> > "@compatibilityVersion" : "CVTY11v10600",  
> > "Mapset" : {  
> > "@xmlns" : "[http://schemas.intuit.com/cg/services/filing](http://schemas.intuit.com/cg/services/filing)",  
> > "@xmlns:xsi" : "[http://www.w3.org/2001/XMLSchema-instance](http://www.w3.org/2001/XMLSchema-instance)",  
> > "@id" : "USIndividual",  
> > "@interfaceVersion" : "CVTY11v10300",  
> > "@implementationVersion" : "2011.2.0.0-SNAPSHOT",  
> > "Map" : {  
> > "@id" : "1040",  
> > "field" : {  
> > "@id" : "DaytimePhoneNumber",  
> > "@status" : "mapped ",  
> > "@tpsid" : "DTPHO",  
> > "@xsi:type" : "Phone",  
> > "value" : {  
> > "@source" : "computed",  
> > "$" : "7777777777"  
> > }  
> > }  
> > }  
> > }  
> > }  
> > }

---

<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:28am UTC](https://discuss.elastic.co/t/basic-query-question/7746/4 "2017-07-06T03:28:04Z")

</div>


