Gravatar for debabrata.biswas@xcentium.com

Question by debu_biswas, May 18, 2017 11:38 AM

Expression Rule operator "starts with" not working

Hello,

When trying to setup boost expression or filter rule for a coveo search tab in sitecore, any operator other than "is equal to" or "is not equal to" is not working for me when I make the comparison for a sitecore item field. My requirement is to check if the field value is starting with a character and hence moving towards "starts with" operator but it does not fetch any results. Please help what could be wrong.

1 Reply
Gravatar for lbergeron@coveo.com

Answer by Luc Bergeron, May 18, 2017 12:24 PM

Hi,

The "starts with", "ends with", and "contains" operators are using the wildcard query operator under the hood. When using wildcards, both conditions must be met:

  1. The field must be set as facet.
  2. The query term must contain at least 2 valid characters. For example `@field *= "a*"` would not work but `@field *= "ar*"` would.

EDIT: There is no constraint on the minimum number of characters when the wildcard is used to query a field. However, the constraint is enforced when the wildcard is used in a regular query term.

I would encourage you to try with some manual queries in the Content Browser and see how it goes.

You can find some more information on wildcards in this topic.

I hope this helps

Gravatar for debabrata.biswas@xcentium.com

Comment by debu_biswas, May 18, 2017 12:43 PM

So what you are saying is just for me to be able to use that operator, I need to define that sitecore field as facetable under "/sitecore/system/Settings/Buckets/Facets/Catalog Number"? I thought a normal field value query should not require that field to be a facet.

Ask a question