Quantcast
Channel: Optimizely Search & Navigation
Viewing all articles
Browse latest Browse all 6894

What does WithAndAsDefaultOperator() do?

$
0
0

I have used QueryStringQuery.DefaultOperator to change the default operator of the query. My intention is to make the search operator 'AND' instead of 'OR'.

IClient client = SearchClient.Instance;
client.Search<SearchType>().For(Query, q=> {
                    q.DefaultOperator = BooleanOperator.And;
                }).Take(1000).GetResult();

And also I have got to know that the WithAndAsDefaultOperator() does the same thing as above ('AND' search instead of 'OR').

IClient client = SearchClient.Instance;
client.Search<SearchType>().For(Query).WithAndAsDefaultOperator().Take(1000).GetResult();

Are these two search implementations do the same thing without any difference in the resultset?

Note: I did not find the WithAndAsDefaultOperator() in the Episerver Find Documentration. It's better if anyone could share the link of that just to refer.

Thanks.


Viewing all articles
Browse latest Browse all 6894

Trending Articles