Gravatar for jpdery@coveo.com

Question by jpdery, Nov 24, 2015 9:47 AM

partialMatchThreshold

Using Coveo for Salesforce V1 :

    search.on('buildingQuery',function(e, args){
        args.queryBuilder.enablePartialMatch = true;
        args.queryBuilder.partialMatchThreshold =  '50%';
        args.queryBuilder.expression.add('test optional asfdasdf');
    });

Above snippet #1 returns 0 results

    search.on('buildingQuery',function(e, args){
        args.queryBuilder.enablePartialMatch = true;
        args.queryBuilder.partialMatchThreshold =  '50%';
        args.queryBuilder.expression.add('test optional');
    });

Above snippet #2 returns more than 1 results

Why did #1 return zero results?

1 Reply
Gravatar for mlaporte@coveo.com

Answer by Martin Laporte, Nov 25, 2015 8:29 AM

Most probably your query doesn't have enough keywords for partial match to be enabled. Look at the partialMatchKeywords option, if I remember well the default value is 5.

Gravatar for jpdery@coveo.com

Comment by jpdery, Nov 25, 2015 9:12 AM

I should have read the manual :) This addition resolves my issue: args.queryBuilder.partialMatchKeywords = 2;

Ask a question