ging / social_stream

A framework for building distributed social network websites
http://social-stream.dit.upm.es/
MIT License
1.13k stars 307 forks source link

thinking-sphinx 2.0.7 has issues finding the models to index #107

Closed luca closed 12 years ago

luca commented 12 years ago

Thinking sphinx rel 2.0.7 has issues finding the models to index if they are inside rails engines and it is unable to generate the correct sphinx.conf file. In social stream the file generated by ts:config or ts:rebuild does not contain indexes for the group and post models resulting in errors while searching.

To reproduce:

the generated development.sphinx.conf file contains only the index for the user model

The issue in ts has been solved here: freelancing-god/thinking-sphinx@3fcecd4ab738c6a52717fcce89a6ad363f6c579e

To fix it I tried to override thinking-sphinx in the social-stream Gemfile but that's not enough (I keep getting the 2.0.7 gem when running bundle in my app)...

The only workaround I found so far is to add

gem 'thinking-sphinx', :git=>'https://github.com/freelancing-god/thinking-sphinx.git', :branch => "rails3"

before

gem 'social_stream', :git=>'https://github.com/luca/social_stream.git'

in my app Gemfile. I think that this could go in the "How to setup the search engine" wiki page

Roendal commented 12 years ago

Hi Luca!

You are totally right about the issue thinking-sphinx has with loading rails3 engine models. The commit you point was done from within SocialStream developing group to solve this. No new version has been relesead yet with this change, and the only workaround to make it work properly is to require rails3 branch in Gemfile (exactly what you have done).

I will add the line to the wiki, I just missed it. As soon as a new version is released the problem will be fixed.

Sorry for the inconvenience and thanks for the comment.

Roendal commented 12 years ago

Hi again!

I've been told that may be interesting maintaining the issue open untill everything is fully functional (when next thinking-sphinx version is released and required by SocialStream) and I fully agree.

So I will reopen it just to close it when no Gemfile workaround is needed.

luca commented 12 years ago

yup, sounds good!