Gravatar for d.kumar.chittimilla@accenture.com

Question by dkchittimilla, Apr 17, 2017 12:43 PM

Get results only if field is not null

Hi,

I am using Coveo JS framework in our project. We have a requirement to pull the results only if the field is not null or empty.

Can somebody suggest, how can I add a FieldExpression in query builders advanced expression to accomplish this requirement.

Thanks in advance.

Regards,

Dilip Kumar

1 Reply
Gravatar for flguillemette@coveo.com

Answer by François Lachance-Guillemette, Apr 17, 2017 1:02 PM

According to the Query Syntax Reference, to check a field is defined with any value, all you have to do is add the field in the query like this:

`@myfield`

Gravatar for d.kumar.chittimilla@accenture.com

Comment by dkchittimilla, Apr 18, 2017 10:01 AM

Hi,

You mean to add it directly in querybuilder expression like below?

queryBuilder.expression.add('@myfield');

Ask a question