Basic Query question


(Mohit Anchlia) #1

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",
"@xmlns:xsi" : "http://www.w3.org/2001/XMLSchema-instance",
"@serviceImplementationVersion" : "TPS.2011.003.09.main.042804",
"@xsi:schemaLocation" :
"http://schemas.intuit.com/cg/services/filingMapML.xsd",
"@compatibilityVersion" : "CVTY11v10600",
"Mapset" : {
"@xmlns" : "http://schemas.intuit.com/cg/services/filing",
"@xmlns:xsi" : "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"
}
}
}
}
}
}


(Mohit Anchlia) #2

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.comwrote:

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",
"@xmlns:xsi" : "http://www.w3.org/2001/XMLSchema-instance",
"@serviceImplementationVersion" : "TPS.2011.003.09.main.042804",
"@xsi:schemaLocation" : "http://schemas.intuit.com/cg/services/filingMapML.xsd",
"@compatibilityVersion" : "CVTY11v10600",
"Mapset" : {
"@xmlns" : "http://schemas.intuit.com/cg/services/filing",
"@xmlns:xsi" : "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"
}
}
}
}
}
}


(Radu Gheorghe) #3

I think you have to define nested types:
http://www.elasticsearch.org/guide/reference/mapping/nested-type.html

and run nested queries:
http://www.elasticsearch.org/guide/reference/query-dsl/nested-query.html

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 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.comwrote:

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",
"@xmlns:xsi" : "http://www.w3.org/2001/XMLSchema-instance",
"@serviceImplementationVersion" : "TPS.2011.003.09.main.042804",
"@xsi:schemaLocation" : "http://schemas.intuit.com/cg/services/filingMapML.xsd",
"@compatibilityVersion" : "CVTY11v10600",
"Mapset" : {
"@xmlns" : "http://schemas.intuit.com/cg/services/filing",
"@xmlns:xsi" : "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"
}
}
}
}
}
}


(system) #4