On 10/03/10 22:59, Gordon Yeong wrote:
hello Andrew,
Bingo. I just made changes using "Status.find_by_name('live')"
and yet it still fails.
Here's how my codes look like:
if (params[:search][:by_keyword])
@search = Part.search(
params[:search][:by_keyword],
:with => { :status_id => Status.find_by_name('live').id },
:page => params[:page],
:per_page => 10
)
I purposely changed the status_id in the database to different values
and rebuilt the thinking sphinx index.
Ran the search but could not get any results.
Any ideas?
Do you have "has status(:id), :as => :status_id" line in your index
block? (please note it's almost always useful to provide the index
definition as part of help requests)
If so, try searching using the :with param only, via the console or the
search command-line program. You can also examine the Sphinx config
generated in config/development.sphinx.conf. If no joy please put the
model associations, index definition, and search code on a paste site
(gist.github.com or Pastie) and let us know.
Regards,
Andrew
--
You received this message because you are subscribed to the Google Groups "Thinking
Sphinx" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/thinking-sphinx?hl=en.