thinking-sphinx

Cancan Thinking Sphinx current_ability Questions

旧巷老猫 提交于 2019-12-03 21:22:35
trying to get cancan working with thinking sphinx but running into some issues. Before using sphinx, I had this in my companies view: @companies = Company.accessible_by(current_ability) That prevented my users from seeing anyone else's companies... After installing sphinx, I ended up with: @companies = Company.accessible_by(current_ability).search(params[:search], :include => :order, :match_mode => :extended ).paginate(:page => params[:page]) Which now displays all my companies and isn't refining per user based on ability. It would see ts isn't set up for cancan? I think it's more that

Thinking sphinx doesn't start - “Failed to start searchd daemon”

拟墨画扇 提交于 2019-12-03 14:08:49
I try to start thinking sphinx on my server but it doesn't want to work. I do: $ rake thinking_sphinx:index && rake thinking_sphinx:start And i get: Generating Configuration to /vol/www/apps/ror_tutorial/releases/20120202111730/config/development.sphinx.conf Sphinx 2.0.3-release (r3043) Copyright (c) 2001-2011, Andrew Aksyonoff Copyright (c) 2008-2011, Sphinx Technologies Inc (http://sphinxsearch.com) using config file '/vol/www/apps/ror_tutorial/releases/20120202111730/config/development.sphinx.conf'... indexing index 'micropost_core'... WARNING: collect_hits: mem_limit=0 kb too low,

How do I add the condition “IS NOT NULL” to a Thinking Sphinx search

[亡魂溺海] 提交于 2019-12-03 13:04:55
I'm using Thinking Sphinx for full-text search, following this video . I'd like to do the following: @articles = Article.search(params[:search], :conditions => "published_at IS NOT NULL", :order => :created_at) The problem is that this doesn't work. It seems that the search method only accepts conditions that are a hash. I've tried a couple of ways, but I am clueless as to how I can represent "published_at IS NOT NULL" as a hash... Was given the solution over at Railscasts If you want *all* results for that model to filter out records where published_at IS NULL, add 'where "published_at IS NOT

Any ideas why Thinking Sphinx Rake tasks are not running?

﹥>﹥吖頭↗ 提交于 2019-12-03 12:50:10
I'm finding that Thinking Sphinx sometimes errors out when I try to run its Rake tasks. Sometimes the tasks work fine, and sometimes I get errors like the one below. I'm running the tasks as a normal user, not root. Not using sudo. In the example below, searchd is still running after the Rake task fails. I've also seen similar errors with ts:rebuild . Has anyone else seen this? I'm using Sphinx 0.9.9-release (r2117) I'm using Thinking Sphinx 1.4.4 instead of the latest version because I'm on Rails 2.3.11. $ rake ts:stop RAILS_ENV=production (in /var/www/blog_app/releases/20110425053509) rake

Add new column without table lock?

眉间皱痕 提交于 2019-12-01 06:50:16
In my project having 23 million records and around 6 fields has been indexed of that table. Earlier I tested to add delta column for Thinking Sphinx search but it turns in holding the whole database lock for an hour. Afterwards when the file is added and I try to rebuild indexes this is the query that holds the database lock for around 4 hours: "update user_messages set delta = false where delta = true" Well for making the server up I created a new database from db dump and promote it as database so server can be turned live. Now what I am looking is that adding delta column in my table with

Add new column without table lock?

走远了吗. 提交于 2019-12-01 04:55:58
问题 In my project having 23 million records and around 6 fields has been indexed of that table. Earlier I tested to add delta column for Thinking Sphinx search but it turns in holding the whole database lock for an hour. Afterwards when the file is added and I try to rebuild indexes this is the query that holds the database lock for around 4 hours: "update user_messages set delta = false where delta = true" Well for making the server up I created a new database from db dump and promote it as

Problem running Thinking Sphinx with Rails 2.3.5

﹥>﹥吖頭↗ 提交于 2019-11-30 17:10:49
问题 I just installed Sphinx (distro: archlinux) downloading the source. Then I installed "Thinking Sphinx" plugin for Rails. I followed the official page setup and this Screencast from Ryan Bates, but when I try to index the models it gives me this error: $ rake thinking_sphinx:index (in /home/benoror/Dropbox/Proyectos/cotizahoy) Sphinx cannot be found on your system. You may need to configure the following settings in your config/sphinx.yml file: * bin_path * searchd_binary_name * indexer_binary

How do I run rake tasks within my rails application

五迷三道 提交于 2019-11-28 20:37:15
问题 What I want to do: In a model.rb, in after_commit, I want to run rake task ts:reindex ts:reindex is normally run with a rake ts:index 回答1: If you wish this rake code to run during the request cycle then you should avoid running rake via system or any of the exec family (including backticks) as this will start a new ruby interpreter and reload the rails environment each time it is called. Instead you can call the Rake commands directly as follows :- require 'rake' class SomeModel <ActiveRecord

Thinking Sphinx and acts_as_taggable_on plugin

孤人 提交于 2019-11-28 19:01:47
I installed Sphinx and Thinking Sphinx for ruby on rails 2.3.2. When I search without conditions search works ok. Now, what I'd like to do is filter by tags, so, as I'm using the acts_as_taggable_on plugin, my Announcement model looks like this: class Announcement < ActiveRecord::Base acts_as_taggable_on :tags,:category define_index do indexes title, :as => :title, :sortable => true indexes description, :as => :description, :sortable => true indexes tags.name, :as => :tags indexes category.name, :as => :category has category(:id), :as => :category_ids has tags(:id), :as => :tag_ids end For

Thinking Sphinx and acts_as_taggable_on plugin

。_饼干妹妹 提交于 2019-11-27 12:08:56
问题 I installed Sphinx and Thinking Sphinx for ruby on rails 2.3.2. When I search without conditions search works ok. Now, what I'd like to do is filter by tags, so, as I'm using the acts_as_taggable_on plugin, my Announcement model looks like this: class Announcement < ActiveRecord::Base acts_as_taggable_on :tags,:category define_index do indexes title, :as => :title, :sortable => true indexes description, :as => :description, :sortable => true indexes tags.name, :as => :tags indexes category