Pooja Sinha
unread,Jan 6, 2017, 6:48:42 AM1/6/17Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to handlebars.java
"BaseQuery.hbs"
<![CDATA[<?xml version='1.0' encoding='utf-8'?>
<query>
<and>
{{> queryStructure}}
</and>
</query>
]]>
"queryStructure.hbs"
{{#each match}}
{{> match}}
{{/each}}
{{#if greaterThan}}
{{#with greaterThan}}
<greaterThan field="{{field}}" value="{{@value}}" />
{{/with}}
{{/if}}
{{#if text}}
{{#each text}}
{{this}}
{{/each}}
{{/if}}
{{#if not}}
<not>
{{> queryStructure this.not}}
</not>
{{/if}}
{{#if and}}
<and>
{{> queryStructure this.and}}
</and>
{{/if}}
On Running this with JSON:
{
"match": [
{
"field": "source",
"@value": "XXX"
},
{
"@field": "site",
"@value": "$$SITE$$"
},
{
"@field": "organisation",
"@value": "$$ORGANISATION_NODE$$"
},
{
"@field": "status",
"value": [
"Valid",
"ITest"
]
},
{
"@field": "snapshot_id",
"@value": "$$SNAPSHOT_ID$$"
}
],
"not": {
"match": {
"@field": "instrumenttype",
"value": [
"XXXX",
"CYYYYBND"
]
}
},
"text": [
"$$BOOKS_EXCLUDED$$",
"$$BOOKS_INCLUDED$$"
],
"greaterThan": {
"@field": "LastDateToPrice",
"@value": "$$BUSINESS_DATE$$"
}
}
Can anyone please help me out why this is returning me the "infinte loop" warning. I want to invoke the partial again for a sub-part of the JSON (part withn not)
Thanks in advance