I am on v8.2

Using SOLR as search index. I have the items indexed and can see them in the index. I kicked off index rebuild a few times.

However, ContentSearchManager.GetIndex("sitecore_web_index").CreateSearchContext().GetQueryable<SearchResultItem>() returns nothing back. What could possibly the reason be?

I see the following in the search logs:

33576 12:10:47 INFO  Query - (_fullpath:(\/sitecore/content/home*) AND _template:(9865d2d89a6b4918863353525f8aad05))
33576 12:10:47 INFO  Serialized Query - ?q=(_fullpath:(\/sitecore/content/home*) AND _template:(9865d2d89a6b4918863353525f8aad05))&rows=2147483647&fl=*,score&fq=_language:(en)&fq=_indexname:(sitecore_web_index) 

The item (both home and the item I am looking for) exists in the index, but like I mentioned nothing is returned back even if I don't apply any filters

  • 1
    There is a typo in your code - missing n in index word: "sitecore_web_idex" – Marek Musielak Nov 18 '17 at 12:09
  • Fat fingers, marek. Typo in the question, not in the code :D – novicecoder Nov 18 '17 at 12:20
  • And what about the 9865d2d89a6b4918863353525f8aad05 template? Is it defined on the SearchResultItem? Is it Sitecore.ContentSearch.SearchTypes.SearchResultItem or your custom one? – Marek Musielak Nov 18 '17 at 12:26
  • Can you try to use .Where(item => item.Paths.Contains(homeItem.ID)) instead of _fullpath? – Marek Musielak Nov 18 '17 at 12:29
  • 1
    @novicecoder check this one stackoverflow.com/questions/4647105/… – Marek Musielak Nov 19 '17 at 20:38

Given that you are seeing the content in your SOLR admin UI, but not in queries, one thing to check is the SOLR URL.

You've probably already checked this, but just in case, you need to validate that the URL you are loading for your SOLR Admin UI is the same SOLR instance you are connecting to from Sitecore.

Load /sitecore/admin/ShowConfig.aspx and check what the SOLR url is. I've seen a rogue patch file change the URL on me in the past to a network instance that doesn't have my data. The setting you are looking for is ContentSearch.Solr.BaseServiceAddress.

<setting name="ContentSearch.Solr.ServiceBaseAddress" value="http://localhost:8983/solr" />
| improve this answer | |
  • Thanks Jay - verified again and the url is correct. I have wrapped the call around try catch anyway, so if the core/server can't be found then an error would be thrown/logged. – novicecoder Nov 19 '17 at 15:20

Your Answer

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

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