Gravatar for

Question by esequielp, Oct 28, 2016 2:43 PM

Help with Wildcards in queries / Coveo cloud v2


We have this requirement where users want that searching for parts of valid words provide results for items that match that criteria.

For example: I search for "la pal" and it returns 0 results. However, searching by "la palma" throws 9 results.

I need some clear instructions on how to enable the wildcard search so that partial matches return valid results. Would you be able to help?

2 Replies
Gravatar for

Answer by esequielp, Nov 2, 2016 9:44 AM

Getting back here to tell how did I solve this.

On my search page I added these javascript files:

<script type="text/javascript" src="/Coveo/js/CoveoForSitecorePolyfills.js"></script>
<script type="text/javascript" src="/Coveo/js/d3.min.js"></script>
<script type="text/javascript" src="/Coveo/js/CoveoForSitecore.min.js"></script>

In the html, in my searchbox I added the CoveoSearchPageSearchBox as this:

  <div type="text" class="CoveoSearchbox CoveoSearchPageSearchbox" 

After that and, of course, also enabling the Wildcards and partial matches in the component properties of the Sitecore rendering, the search started to work as expected.

Gravatar for

Comment by Sébastien Belzile, Nov 2, 2016 9:53 AM

Not sure I understand what the problem was…

  • On Coveo search pages, the list of resources are usually included in the CoveoSearchResources component.
  • How was your searchbox defined in the first place?

I don't make the link between wildcards not working and yout "fix".

Gravatar for

Comment by esequielp, Nov 2, 2016 10:10 AM

Yes, consider that I am maintaining a project and, at first glance, it looked as a std implementation of the CoveoSearchResources component. When I started to dig around and stepped into details, I noticed that the controls were copies of the OOB components from Coveo but were customized. In that customization, the js were removed as well as a the class name in the searchbox. Thanks for replying.

Gravatar for

Answer by Sébastien Belzile, Oct 28, 2016 2:56 PM

  1. Partial match is a different concept.
  2. Enabling wildcards can be done with the Querybox parameters.

I will let someone else answer for your use case, since I am not sure of how Coveo indexes work on that level.

Gravatar for

Comment by esequielp, Oct 28, 2016 3:04 PM

Appreciate your reply. At this moment, I want to see it working on the search box. I understand the difference of partial match / wildcards but none of them are working as expected. (Though at least the wildcards seems to be enabled in the index json file)

Any other info on how to set this up, would be appreciated.

Gravatar for

Comment by Sébastien Belzile, Oct 28, 2016 3:14 PM

Wildcards require a minimum amount of letters: it is mentionned in this article:

Partial match requires a minimum number of words as well.

Gravatar for

Comment by Jean-François L'Heureux, Oct 28, 2016 3:23 PM

Also wildcards need an explicit star wildcard character at the end of the words to complete

la pal*
Ask a question