Hi,

I'm new to MarkLogic and I'm facing a problem when I try to define a JSON
key/value constraint via the Java REST API client.

I'm using MarkLogic v8

My Java code is :


        QueryOptionsManager optionsMgr =
client.newServerConfigManager().newQueryOptionsManager();


        QueryOptionsBuilder qob = new QueryOptionsBuilder();


        QueryOptionsHandle optsHandle = new
QueryOptionsHandle().withConstraints(
            qob.constraint("tag",
                qob.collection("")));

        // add a JSON value constraint
        optsHandle.addConstraint(
            qob.constraint("company",
                qob.value(
                    qob.jsonTermIndex("affiliation"))));


The error thrown is :

Status 500: RESTAPI-INVALIDCONTENT: (err:FOER0000) Invalid content:
Operation results in invalid Options: Use "json-property" instead of
"json-key" to specify structures in JSON. Validation detail:
XDMP-VALIDATEUNEXPECTED: (err:XQDY0027) validate strict { $opt } -- Invalid
node: Found search:json-key but expected
((((((search:element)|search:attribute)|search:json-property|search:field)|search:fragment-scope)*)|((search:term-option|search:weight)*))*
at
fn:doc("")/search:options/search:constraint[2]/search:value/search:json-key
using schema "search.xsd"An <element>, <json-property> or <field>
specification is required on <value>.

My question is how to use "json-property" instead of "json-key" as
suggested ?

Thanks,

-- 
*Hamza BENNANI*
_______________________________________________
General mailing list
[email protected]
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to