4

I have a Sitecore 8.1 / Solr 4.10 solution. I am noticing that with a complex Linq query that includes a lot of parentheses that sometimes Solr returns no results. But if I remove the parentheses and submit the query to Solr manually then the query works.

Here is the original query from the Sitecore Search.log file:

8124 12:12:30 INFO  Serialized Query - ?q=*:*&start=0&rows=20&fl=*,score&fq=(((read_roles_sm:(extranet_anonymous_role) AND -denied_roles_sm:(extranet_anonymous_role)) AND (_path:(f0a12cf0ac2840619048797a1b893e00) AND (-_templatename:(*folder*) AND (((-sanitizedpath_s:(*_safety_data_sheets*) AND -sanitizedpath_s:(*_msds_files*)) AND -sanitizedpath_s:(*_some_new_path*)) AND -sanitizedpath_s:(*_f\(x\)*))))) AND _language:(en))&fq=_indexname:(sitecore_web_index)

That query returns no results. But if I remove the parentheses and submit this query it works.

/select?q=*:*&start=0&rows=20&fl=*,score&fq=read_roles_sm:(extranet_anonymous_role)%20AND%20-denied_roles_sm:(extranet_anonymous_role)%20AND%20_path:(f0a12cf0ac2840619048797a1b893e00)%20AND%20-_templatename:(*folder*)%20AND%20-sanitizedpath_s:(*_safety_data_sheets*)%20AND%20-sanitizedpath_s:(*_msds_files*)%20AND%20-sanitizedpath_s:(*_some_new_path*)%20AND%20-sanitizedpath_s:(*_f\(x\)*)%20AND%20_language:(en)&fq=_indexname:(sitecore_web_index)

Any ideas?

2

1 Answer 1

1

The solution was to use the Sitecore Support binary #398622 as explained in https://stackoverflow.com/questions/31458086/how-do-i-control-the-priority-of-nested-queries-in-sitecore-contentsearch-with-t. Once I did that the problems went away.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.