Gravatar for

Question by mark, May 29, 2015 9:57 AM

Search exact phrase match with jsframeworks

Hi, I am using the jsframework and would like to know how to search for exact phrase match when the phrase contains a 'dot' for example "section 21.1" . Currently, when I search for said term, results are returned containing section 21(1) but this is not an exact match.

How will I search for the above term to return an exact match.


1 Reply
Gravatar for

Answer by Jean-François L'Heureux, May 29, 2015 10:13 AM

Coveo replaces all special characters (dot, parenthesis, braces, dashes, commas…) by spaces when indexing and don't keep them in the index.

So "21.1" is seen as 2 terms ("21" followed by "1") for the index and query engine.

When searching for "21.1" in exact phrase, you are in reality searching for "21" immediately followed by "1". This is the reason why "21(1)" is returned. "21!/$%?&*()-=1" would also be returned if it was present in a document.

Hope it helps.

Gravatar for

Comment by mark, May 29, 2015 10:18 AM

Hi, thanks for your speedy reply. How would I go about searching for exact phrases which contain special characters such as the 'dot'?


Gravatar for

Comment by Daniel Lavoie, May 29, 2015 4:55 PM

You can search for special characters only if you are using a field, and the field is a facet. If that is the case, you can use advanced search operators like wildcards and regex.

For example, respectively regular expression and wildcards:

@myIPAdressField /= "^(?:[0-9]{1,3}.){3}[0-9]{1,3}$"

@chapter *= "*section*.?"

Phonetic (%=) and fuzzy (~=) are also available but wouldn't be of much use to you and your case.

Ask a question