Gravatar for gling@houstonmethodist.org

Question by qch1595, Mar 1, 2017 9:34 AM

enable partial match in CES/REST API

I want to find "Thomas" by typing "mas" in CES or REST API. Is it possible? Thanks.

1 Reply
Gravatar for flguillemette@coveo.com

Answer by François Lachance-Guillemette, Mar 1, 2017 10:46 AM

What you are looking for is wildcard matching since partial match is a different concept.

You can activate them with the enableWildcards option on your querybox.

When activated, you can modify the query to instead search for *mas instead of mas. Note that it will affect query performance as wildcard match is an expensive operation.

Gravatar for gling@houstonmethodist.org

Comment by qch1595, Mar 1, 2017 12:22 PM

Where to set the enableWildcards option? Is it in a config file? Does it work for the REST API too? Thanks.

Gravatar for flguillemette@coveo.com

Comment by François Lachance-Guillemette, Mar 1, 2017 12:52 PM

As specified in my answer, you must set the option as an attribute for your querybox.

Have a look at the coveo-search-ui tutorial for some examples.

Gravatar for gling@houstonmethodist.org

Comment by qch1595, Mar 1, 2017 3:09 PM

Sorry I didn't make it clear at the beginning. We don't use Javascript search so far. We use the REST API. That is why I was confused about finding the enableWildcards option and the "query box". Is it possible to have this feature in the REST API?

Gravatar for flguillemette@coveo.com

Comment by François Lachance-Guillemette, Mar 1, 2017 3:22 PM

Yes, have a look at the REST API reference

Gravatar for gminero@coveo.com

Comment by gminero, Mar 3, 2017 2:56 PM

@qch1595, were you able to enable it?

Gravatar for gling@houstonmethodist.org

Comment by qch1595, Mar 3, 2017 3:07 PM

Not yet. We have 2 versions of Coveo installed. The old one was wildcards enabled out of the box. The REST API worked just perfect. Now we installed the newer version(4.0). For some reason, it doesn't work for wildcard search out of the box. If I have to use "enableWildcards" with the REST API, can you please provide an example? Thanks.

Ask a question