Gravatar for jpdery@coveo.com

Question by jpdery, May 23, 2014 9:55 AM

why would $correlateUsingIdf actually -filter- results ?

I have here a case where the same REST params are sent, except for a $correlateUsingIdf expression in aq.

One says:

aq: "@sfid=[[@sfproductarticlecknowledgearticleidc] @objecttype==("ProductArticleC") @sfwebproductsupportproductid=="a07e0000001Eli9AAC" ] OR  ( @sfrecordtypename=(Software,Videos,Document,Warranty) @sfid=[[@sfsoftwaredocsimageid] @objecttype==("WebProductToContentC") @sfwebproductsupportproductid=="a07e0000001Eli9AAC" ] ) 

$correlateUsingIdf(keywords: "access violation in setpoint software")"

The other says:

aq: "@sfid=[[@sfproductarticlecknowledgearticleidc] @objecttype==("ProductArticleC") @sfwebproductsupportproductid=="a07e0000001Eli9AAC" ] OR  ( @sfrecordtypename=(Software,Videos,Document,Warranty) @sfid=[[@sfsoftwaredocsimageid] @objecttype==("WebProductToContentC") @sfwebproductsupportproductid=="a07e0000001Eli9AAC" ] ) 

$correlateUsingIdf(keywords: "cannot remove battery")"

The second retuns less resutls (actually, the results from the irght-side of the OR).

If I remove the $correlateUsingIdf, the result sets are identical.

1 Reply
Gravatar for apare@coveo.com

Answer by Alexandre Paré, May 23, 2014 9:58 AM

You can add the parameter forceOneMatch to false

Gravatar for mlaporte@coveo.com

Comment by Martin Laporte, May 23, 2014 9:59 AM

That's right. But also, you may want to use the more recent $some extension instead of $correlateUsingIdf. It does something much similar but you can control the nb of keywords that should match, etc.

Gravatar for jpdery@coveo.com

Comment by jpdery, May 23, 2014 10:10 AM

Note1: doc does not says that param forceOneMatch param $correlateUsingIdf is defaulted to True. Note 2: doc of $some does not say explicitly it is a ranking function (i can get easily confused, you know.)

Gravatar for apare@coveo.com

Comment by Alexandre Paré, May 23, 2014 10:13 AM

https://developers.coveo.com/display/SearchREST/Standard+Query+Extensions#StandardQueryExtensions-$correlateUsingIdf https://developers.coveo.com/display/SearchREST/Standard+Query+Extensions#StandardQueryExtensions-$some

Gravatar for apare@coveo.com

Comment by Alexandre Paré, May 23, 2014 10:16 AM

I will update it

Gravatar for jpdery@coveo.com

Comment by jpdery, May 23, 2014 10:25 AM

I though if I used match of $some(keywords:'foo', match:0) , match:0 would act as forceOneMatch=false, but does not seem tol. I fall back using $correlateUsingIdf(keywords:'foo', forceOneMatch:false)

Gravatar for apare@coveo.com

Comment by Alexandre Paré, May 23, 2014 10:35 AM

$some(keywords: 'a b c d', match: 50%) = (a b) or (a c) or (a d) or (b c) or (b d) or (c d)

$some with match set to 0… not sure if this works.

Ask a question