# Thinking sphinx && globalize2

**URL:** <https://www.ruby-forum.com/t/thinking-sphinx-globalize2/183504>\
**Category:** Rails I18n\
**Created:** [February 15, 2010, 7:26pm UTC](https://www.ruby-forum.com/t/thinking-sphinx-globalize2/183504 "2010-02-15T19:26:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![axyd80](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/82dd89/32.png) [@axyd80](https://www.ruby-forum.com/u/axyd80)\
**Post date:** [February 15, 2010, 7:26pm UTC](https://www.ruby-forum.com/t/thinking-sphinx-globalize2/183504/1 "2010-02-15T19:26:07Z")

</div>

Hi all.  
Could you tell me plz - how to integrate sphinx search with  
globalize2? I’d like to perform search in models with translations.

Thanks a lot.

---

<div class="post-metadata">

**Author:** ![axyd80](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/82dd89/32.png) [@axyd80](https://www.ruby-forum.com/u/axyd80)\
**Post date:** [February 15, 2010, 10:47pm UTC](https://www.ruby-forum.com/t/thinking-sphinx-globalize2/183504/2 "2010-02-15T22:47:28Z")

</div>

Actually, it’s way easier than you might think – you just use the  
association as you would with other models, only with globalize2, the  
association is always called “globalize\_translations”.

So if you have an article model with title and body being translated  
and you want to index both, the index definition might look something  
like the following:

define\_index do  
index globalize\_translations.title  
index globalize\_translations.body  
end

You can also somehow split indexes by locale so that when searching in  
English you only get English translation – but I’ve never done that  
and I’m not sure how to do that with (thinking) sphinx.

HTH

---

<div class="post-metadata">

**Author:** ![axyd80](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/82dd89/32.png) [@axyd80](https://www.ruby-forum.com/u/axyd80)\
**Post date:** [February 15, 2010, 10:55pm UTC](https://www.ruby-forum.com/t/thinking-sphinx-globalize2/183504/3 "2010-02-15T22:55:04Z")

</div>

except that with current master it’s now #translations

🙂

---

<div class="post-metadata">

**Author:** ![axyd80](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/82dd89/32.png) [@axyd80](https://www.ruby-forum.com/u/axyd80)\
**Post date:** [February 16, 2010, 10:29am UTC](https://www.ruby-forum.com/t/thinking-sphinx-globalize2/183504/4 "2010-02-16T10:29:13Z")

</div>

Thanks, guys!
