I have a structured JSON data in the following form:
field1:{
"id" : "123",
"field2" : [
{
"id" : "345",
"type" : "ABC"
},
{
"id" : "456",
"type" : "XYZ"
},
]
}
I'm converting this JSON into lucene document as
field1.id : 123
field1.field2.id : 345
field1.field2.type: ABC
field1.field2.id : 456
field1.field2.type: XYZ
I've a query which states that type should be equal to ABC i.e +field1.field2.type: ABC. I need to find the exact id for the field failing, in this case.. 123->345. How can I achieve that ?
I cannot store the id in the field like field1.123.field2.456.type - it is not possible. Is there any possible way to do with SortedSetDocValuesField or FeatureField. Anything that lucene provides to store the id attached with the value for a specific field.
For me, field2 is an array of objects so the right conversion would be ( or an equivalent) :
Can you add your code so we can analyse better please