Gravatar for

Question by Jim Lynch, Jun 28, 2016 1:21 PM

Fail to get result when specifying expression and advanced expression

I am building an Advanced Expression (aq) when the user provides an expression in the Search box. For example, if the user enters 2233 and clicks on a specific tab (Salesforce app), I will build an advanced query to search an indexed field for that string. Here is the aq: @sfsolutionwbanumberc /= ".2233."

The sfsolutionwbanumberc field is Free Text Searchable.

The REST Query has q=2233 and aq=@sfsolutionwbanumberc /= ".2233." but no results are returned. But if I disable the building of the aq and just enter '@sfsolutionwbanumberc /= ".2233."' in the Search box, I get the expected results. Searching for just '2233' does not return any results since that value is not in the body of the documents that are searched but the text is in the indexed field sfsolutionwbanumberc .

I also tried using a logical operator with q and aq but no luck.

Is there a way to use q and aq in the same REST query ?

Gravatar for

Comment by Jim Lynch, Jun 28, 2016 2:05 PM

My expression should read: .2233..

1 Reply
Gravatar for

Answer by olamothe, Jun 28, 2016 5:48 PM

And if you enter both search parameter in the search box, do you get any result ?

That is :

2233 @sfsolutionwbanumberc/=".2233

directly in the search box

Gravatar for

Comment by Jim Lynch, Jun 28, 2016 5:58 PM

If I enter: 2233 @sfsolutionwbanumberc /= ".2233." i get no result. In matter of fact, if I enter 2233, I don't get a result either since the match only occurs in the indexed field, sfsolutionwbanumberc

Gravatar for

Comment by olamothe, Jun 28, 2016 6:06 PM

In that case I would probably use the disjunctionExpression to put the advanced query part.

This will put in in OR with the rest of the query.

Gravatar for

Comment by Jim Lynch, Jun 29, 2016 10:26 AM

Perfect. Thanks much.

Ask a question