• Not Answered

How to properly index content using Solr 4.7 and Sitecore 7.5 with partial language fallback?

I have a solution that is using Sitecore 7.5 and Solr 4.7 and also the shared source Partial Language Fallback module from Alex Shyba.  Here's one thing I can't figure out.  I can't figure out how to get search indexing to work properly.  Since I am using the Partial Language Fallback module, I will not necessarily have content items in all languages.  For example if someone switches the site language to French and views the site, the will see mostly English content and some French content.  But how does indexing work?  If I don't have a French version of an item, then Solr will not index a French version of that item - right?  So when someone does a search while French is the context language, they won't have that item in the search index right?

My guess here is that somehow I need to create a version of every item in the site in ALL languages.  Even if those items have no field values.  They have to at least be there for Solr to index them.  Then secondly, I have to figure out how to get Solr to use the language fallback stuff so that when it indexes the French version of an item (which has no field values itself) - it will pick up the English values of that item and index the English values in the French version of the item.  But I have no idea how to do any of that and I can't seem to find a blog post or any documentation that shows how to do that.

Any ideas?  Am I thinking about this correctly?

5 Replies

  • First, there are different fallback strategies. Field-level is most likely done via the StandardValuesProvider and yes, you need to have a version in the language for the fallback to kick in. We built a Language Tool wizard in SCORE that can create empty language versions to help in exactly this scenario. You can also do item-level fallback with ItemProvider which will make it appear as if an item had a version in the language even if it doesn't. The good thing about both is that you fallback on the Sitecore API level. Services like search crawlers and publishing all work via those APIs (until you wrote your own, of course) and as a result they all "see" the fallback. Publishing will actually "materialize" the fallback value and the crawler on CD will work with the items and field values as if those were real.
  • In reply to Pavel Veller:

    Ok, so it sounds like all I need to do is make sure that I have a version of every item in every language. If I have that, then Solr should index everything properly and take the fallback stuff in to account automatically because it works at the API level. Right?
  • In reply to Corey Burnett:

    I believe so, yes. SOLR isn't indexing itself. Sitecore runs a crawler that pushes stuff into the index. The default Item Crawler is using Sitecore APIs, I believe, not database queries
  • In reply to Corey Burnett:

    You could also implement both item-level and field-level fallback, a strategy I like to call "super lazy fallback." :) I did some work awhile ago to get the two working together, don't have it accessible to share but I do know that they can work in tandem.
  • In reply to Nick Wesselman:

    Hi there,

    Could you share an example, please? How can I implement item-level and field-level fallback? I found how to do this for Lucene


    do my essay