We just upgraded our 7.2 to 8.1 which uses lucene search provider. The website relies heavily on lucene for search and indexing the articles so that it can be displayed as a list.
We already have a SOLR instance setup. We need to get this Lucene converted to SOLR. Will appreciate if I get direction on below:
How do we convert the custom computed lucene indexes and fields on to Solr?
Apart from configurations on CORES and end points, are there any code changes etc. that we need to be careful of?
How does the index rebuild event works in terms of SOLR. Do they (CDs) all try to build once or in sequence or only one triggers build.
UPDATE:
I switched to SOLR. I can rebuild all the CORES and web_index shows 11K documents. However the page doesn't return any results. Below is the code snippet, appreciate if I can get help on what I'm doing wrong. THis was working fine with Lucene:
public IEnumerable<Article> GetArticles(Sitecore.Data.ID categoryId)
{
List<Article> articles = null;
var home = _sitecoreService.GetItem<Sitecore.Data.Items.Item>(System.Guid.Parse(ItemIds.PageIds.Home));
var index = ContentSearchManager.GetIndex(new SitecoreIndexableItem(home));
using (var context = index.CreateSearchContext(SearchSecurityOptions.DisableSecurityCheck))
{
var query = context.GetQueryable<ArticleSearchResultItem>().Filter(item => item.Category == categoryId);
var results = query.GetResults();
articles = new List<Article>();
foreach (var hit in results.Hits)
{
var article = _sitecoreService.GetItem<Article>(new Sitecore.Data.ID(hit.Document.Id).ToGuid());
if (article != null)
{
if (article.ArticlePage != null && !article.ArticlePage.HideInNavigation)
{
articles.Add(article);
}
}
}
}
return articles;
}