Gravatar for

Question by Hussain Shaik, May 2, 2017 9:08 AM

QRE is not working as expected

i am using JS framework with Coveo cloud.

I need to boost the results based on field contains a word. if that field contains a keyword , then i need to boost the results.

for example : input query is xyz and the results should come if field1 contains 'abc'.

var queryBuilder = new Coveo.QueryBuilder(); queryBuilder.advancedExpression.add("$qre(expression:'@fkeywordsXXXXX=abc', modifier:'75')"); queryBuilder.expression.add('xyz');

var coveoQuery =;

Coveo.SearchEndpoint.endpoints["default"].search(coveoQuery).done(function (data) { });

1 Reply
Gravatar for

Answer by Sébastien Belzile, May 2, 2017 11:23 AM

This can happen. I will need more information to tell you what the problem is.

Boosting adds weight to a document score. This means if you have a modifier of 75, you should see 750 added to documents matching the expression.

But if your document has a base score that is much lower, you should not see it in your results.

In that case, you could increase your modifier to add more weight to your document.

You can actually see document score in the JSON of returned documents. Results have a field "score" which is the actual document score. Furthermore, the field "rankingInfo" might interest you as well.

Gravatar for

Comment by Hussain Shaik, May 2, 2017 11:38 AM

i have taken from one of the result.



is there any problem with my JS code?

Ask a question