Are queries case-sensitive?

Coveo queries are case-insensitive, meaning that a query for a term can return items containing any casing variant of that term.

However, the unified index records the casing variants found in indexed items, such as terms with the first, all, or some letters in uppercase. When you search for a specific casing variant, the search results include all casing variants of the searched term, but results containing the searched casing variant are ranked higher.

Note

To preserve semantic distinctions conveyed by capitalization, SE, CSE, RGA, and CPR models are case-sensitive and retain the original casing of queries and indexed content when creating embeddings. Because these models use semantic retrieval, which relies on vector representations of the query and indexed content, differences in casing, such as Apple and apple or Turkey and turkey, can affect the similarity scores between the query and the indexed content.

When using these models, casing differences between the query and the indexed content can have the following effects:

  • SE and CSE models: Casing differences can affect search result ranking or cause items to fall below the model’s minimum similarity threshold, excluding them from semantic retrieval. However, because the model’s semantic retrieval works with Coveo’s traditional lexical search to return results, items excluded from semantic retrieval may still be returned by lexical search. For more information, see Case sensitivity in SE models or Case sensitivity in CSE models.

  • RGA and CPR models: Casing differences can affect which segments of text (passages) are retrieved for the query, how they’re ranked, and ultimately the answer or output that’s generated. These models retrieve passages from the most relevant items returned by Coveo search, which combines lexical search with semantic retrieval from the SE model. Therefore, casing differences can affect which items are available to the RGA or CPR model, as well as which passages the model retrieves from those items. For more information, see Case sensitivity in RGA models or Case sensitivity in CPR models.

Tip

Because by default queries are expanded using stemming, returned items also include related terms sharing the same root. To reduce the number of results, you can however disable the stemming expansion using the exact term prefix (+) in front of your casing variant term so that the search results only return items containing casing variants of the term, not those containing the other terms sharing the same stem.