Hi, Mrinmoy:

On MarkLogic 6, you should be able come close to a boost query with


<search:query xmlns:search="http://marklogic.com/appservices/search";>
  <search:and-query>
    YOUR_MATCHING_QUERY_HERE
    <search:or-query>
      YOUR_BOOSTING_QUERY_HERE
      <search:and-query/>
    </search:or-query>
  </search:and-query>
</search:query>

or the cts:query equivalent


cts:and-query((
  YOUR_MATCHING_QUERY_HERE,
  cts:or-query((
    YOUR_BOOSTING_QUERY_HERE,
    cts:and-query(())
    ))
  ))

Within the or query, the and query matches everything, so the boosting query 
should only affect ranking and not matching.


Hoping that helps,


Erik Hennum

________________________________
From: [email protected] 
[[email protected]] on behalf of Mrinmoy Khamrui 
[[email protected]]
Sent: Monday, September 08, 2014 11:17 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] using cts:boost-query with search:resolve 
in Marklogic 7

Hi Erik,

Is there a way to implement cts:boost-query in marklogic 6 apart from using 
document quality? We need to have similar feature on marklogic 6. Please 
suggest.

Thanks
Mrinmoy

On Fri, Sep 5, 2014 at 10:25 PM, Mrinmoy Khamrui 
<[email protected]<mailto:[email protected]>>
 wrote:
Hi Erik,

Thanks for pointing that. It worked.

-- Mrinmoy


On Fri, Sep 5, 2014 at 8:38 PM, Erik Hennum 
<[email protected]<mailto:[email protected]>> wrote:
Hi, Mrinmoy:

The search:resolve() function expects the serialized version of the cts:query.  
Try:

    let $results := search:resolve(<q>{$query}</q>/*, $options, $start, 
$pageRecs)

See:

    http://docs.marklogic.com/search:resolve


Hoping that helps,


Erik Hennum

________________________________
From: 
[email protected]<mailto:[email protected]>
 
[[email protected]<mailto:[email protected]>]
 on behalf of Mrinmoy Khamrui 
[[email protected]<mailto:[email protected]>]
Sent: Friday, September 05, 2014 7:38 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] using cts:boost-query with search:resolve 
in Marklogic 7

Hi Erik,

Many thanks. Please find below the error. I can execute the same query with 
cts:search but search:resolve complains



[1.0-ml] XDMP-AS: (err:XPTY0004) $ctsquery as element() -- Invalid coercion: 
cts:boost-query(cts:path-range-query("/products/product/productcategoryassociations/catalog[@code
 = &q...", "=", xs:int("10001"), (), 1), 
cts:path-range-query("/products/product/edition", ">", 0, 
("score-function=linear","slope-factor=10"), 1)) as element()

Stack Trace
In /MarkLogic/appservices/search/search.xqy on line 64
In xdmp:eval("xquery version &quot;1.0-ml&quot;;&#10;&#10;import module 
namesp...", (), <options 
xmlns="xdmp:eval"><database>13679529190427072881</database><isolation>different-tr...</options>)
In /MarkLogic/appservices/qconsole/qconsole-amped.xqy on line 202
In amped-qconsole:qconsole-eval("xquery version 
&quot;1.0-ml&quot;;&#10;&#10;import module namesp...", (), <options 
xmlns="xdmp:eval"><database>13679529190427072881</database><isolation>different-tr...</options>)

$xquery := "xquery version &quot;1.0-ml&quot;;&#10;&#10;import module namesp..."
$vars := ()
$options := <options 
xmlns="xdmp:eval"><database>13679529190427072881</database><isolation>different-tr...</options>


On Fri, Sep 5, 2014 at 7:53 PM, Erik Hennum 
<[email protected]<mailto:[email protected]>> wrote:
Hi, Mrinmoy:

Can you provide the invalid coercion error?  Including the expression, module,
and line number identified by the error (and the specific MarkLogic version)?


Thanks,


Erik Hennum

________________________________
From: 
[email protected]<mailto:[email protected]>
 
[[email protected]<mailto:[email protected]>]
 on behalf of Mrinmoy Khamrui 
[[email protected]<mailto:[email protected]>]
Sent: Friday, September 05, 2014 6:59 AM
To: [email protected]<mailto:[email protected]>
Subject: [MarkLogic Dev General] using cts:boost-query with search:resolve in 
Marklogic 7

Hi Folks,

I am trying to use cts:boost-query with search:resolve and getting invalid 
coercion. Below is my code snippet.

let $query := search:parse($search-term,$options)
let $query := cts:boost-query(cts:query($query), cts:path-range-query("somepath 
with path index", ">", 0,
  ("score-function=linear","slope-factor=10")))

let $results := search:resolve($query, $options, $start, $pageRecs)

Any suggestion is highly appreciated.

Thanks
Mrinmoy

_______________________________________________
General mailing list
[email protected]<mailto:[email protected]>
http://developer.marklogic.com/mailman/listinfo/general



_______________________________________________
General mailing list
[email protected]<mailto:[email protected]>
http://developer.marklogic.com/mailman/listinfo/general



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

Reply via email to