Hi,

 

I am trying to create a query using relevance with querybuilder in node.js

 

My first attempt looks like this:

 

    db.documents.query(

        q.where(

            q.collection("housedata"),

                q.parsedFrom(req.body.SearchString))

                .orderBy(q.sort(q.score("random"), "descending")

        )                   

    )

 

But this results in an error:

{ [Error: query documents: response with invalid 400 status]

  message: 'query documents: response with invalid 400 status',

  statusCode: 400,

  body:

  { errorResponse:

  { statusCode: 400,

        status: 'Bad Request',

        messageCode: 'REST-INVALIDPARAM',

        message: 'REST-INVALIDPARAM: (err:FOER0000) Invalid parameter:
Invalid combined search\nRESTAPI-INVALIDCONTENT: (err:FOER0000) Invalid
content: Operation 

results in invalid Options: XDMP-VALIDATEUNEXPECTED: (err:XQDY0027) validate
strict { $opt } -- Invalid node: Found text{"random..."} but expected () 

at /search:search/search:options/search:sort-order/search:score/text() using
schema
"search.xsd"text{"random..."}()/search:search/search:options/search:sort-ord
er/search:score/text()"search.xsd"' } } }

 

If I use score() with no argument it is working, bur no ranking info is
returned.

 

Can anybody help me out?

 

Thanks in advance !

 

Martin Vollmer

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

Reply via email to