Recently migrated from Lucene to Solr search(7.2.1) in Sitecore.

When I try to get the search results from Code, I'm getting the exception

Non-static method requires a target

However, from Solr Admin, for the same index, I'm able to get the results in Query window.

Please help. enter image description here

  • Try changing the order of Select(s => s.GetItem()) and ToList(), so the line will be query.ToList().Select(s => s.GetItem()); – Marek Musielak Jul 2 at 7:30
  • This confusing exception could be when "s" is null. Try filter it before selection: query.Where(x=>x != null).Select(s => s.GetItem()).ToList(); – Anton Jul 2 at 9:35
  • Check your search logs to see what search is being executed and try executing exactly that search in your Solr Admin. Do you get the expected results? – Dan Sinclair Jul 2 at 12:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.