How to properly index Sitecore 7 content in Solr with partial language fallback?
Asked Answered
A

0

21

I have a Sitecore 7.5 site that uses Solr 4.7 as the search engine. It works great. This is a multi-language site. I am also using the Partial Language Fallback module written by Alex Shyba. I have adapted it to work with Sitecore 7.5 and it works well. The last part that I can't figure out is how to get the Solr search to work with partial language fallback. I am guessing that what I need to do is somehow at indexing time I need to index the content for all languages and pull field values from the fallback language as necessary. So let's say that I have the following:

  • The site has 4 languages (English, Spanish, French, German)
  • a Contact Us Page with 3 fields (Title, Subtitle, Content)
  • There is an English version of the Contact Us page
  • There is a Spanish version of the Contact Us page with all 3 fields filled out in Spanish
  • There is a French version of the Contact Us page that only has the Content field filled out in French
  • There is no German version of the Contact Us page

The Partial Language Fallback module handles this scenario perfectly. No matter what language is the current context language, I still see the Contact Us page and all of the fields on the page.

But I'm not sure how I should have Solr index this content. My guess is that somehow I need to tell Solr when it indexes to create a full index of the Contact Us page in all 4 languages and use the English content for each field if there is no content in that language. I found a blog post online that showed how to do this for Lucene. But I'm not sure how I would do this with Solr. Does anyone know how to handle this in Solr?

Aldous answered 5/5, 2015 at 18:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.