thinking-sphinx

saving search terms rails thinkingsphinx

I use TS for full text search in my rails app. I am trying to save the search term to present "most searched" type list in my app. Here is my search controller index action. I notice that with the "save" the search feature the search takes about 1.28s and without it about 1.04s. Couple of questions. 1- Is there a better way to do this,...

Ruby on Rails: Adding a user for login to my existing app killed my index

I have an app that I've been developing that has so far only been a single user environment. I finally got to the point where I needed to add multi-user capabilities so I followed the railscast on authlogic to get a simple login. I then added a has_many :items and accepts_nested_attributes_for :items and a belongs_to :user to the corre...

Thinking Sphinx: is it possible to use complex logic with attributes?

Hi, This question is in a way related to this other question: http://stackoverflow.com/questions/869733/sphinx-filters-can-i-have-an-or-between-filters-attributes It seems to me that sphinx now has support for OR logic to filter with attributes, but there is no way to use that feature through thinking sphinx. Is it possible to use a...

Ruby on Rails: Thinking Sphinx Delayed Delta Isn't Working by Following Documentation

Following the delayed delta guide here (at the bottom) I did everything that the documentation asked. After I did all of the steps there, I ran a rake ts:rebuild and a rake ts:dd and attempted to load my app (development). When it loads, I get: NameError in CustomersController#index uninitialized constant ThinkingSphinx::Deltas::Delaye...

Wildcard Number Search for thinking Sphinx

Hi, Can any one guide how to search number with wildcard on thinking sphinx... I have tried, by using User.search "12", :star => true which result only 12 but i need to display the number whichever has 12. like prefix and suffix... ...

Thinking Sphinx delta indexing - delta index not getting updated

I have delta indexing setup for thinking sphinx on one of my models. When ever a record gets updated, the delta is being set to True, but I don't see the index getting updated with the changes made to the record. I have my sphinx configuration files updated with the delta property changes. Any idea why the delta indexing is not getting t...

Thinking Sphinx without condition on 'id'

According to the documentation on Thinking Sphinx it should be possible to add a filter condition on id, but the following code does not give any results: User.search(:without => {:id => [1,3]}) What am I doing wrong? Is there another way of doing this? ...

Thinking-Sphinx doesn't index anything.

My environment: Mac OSX 10.6 Snow Leopard Ruby 1.9.2p0 Rails 3.0.0 thinking-sphinx (2.0.0.rc1) Sphinx 0.9.9-release (r2117) So far I haven't really been able to get anything to work. pma:log pma$ rake thinking_sphinx:index (in /Users/pma/Sites/urban-ent) DEPRECATION WARNING: Rake tasks in /Users/pma/Sites/urban-ent/vendor/plugins/yam...

How do I run rake tasks within my rails application.

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 ...

will_paginate ajax pagination with thinking sphinx

Has anyone ever tried paginating a thinking sphinx result set thru ajax? I have this is in my controller action: @results = Model.search params[:query], :page => params[:page] || 1, :per_page => 1 and in my application.js: $(".pagination a").live("click", function() { $.get(this.href, null, null, "script"); return false; });...

How to do attribute matching in (thinking) sphinx extended2 mode?

I have this expression which is working as expected in Thinking Sphinx: Customer.search :with => {:signer_id => 23} but I need to write an expression with OR of some attributes, like signer_id is 23 or admin_level is 42, so I moved to extended match mode and wrote this: Customer.search "@signer_id 23", :match_mode => :extended2 whi...

Issue with thinkingsphinx/pagination and mecached

I memcached (with Dalli client) some of my search results like.. def self.city_search city, per_page, page, order Rails.cache.fetch("#{city}_#{page}_#{order}") do Post.search(:include => [:poster, :category],:geo => location_lat_lng_radian(city), :with => {"@geodist" => 0.0..(Constants::PROXIMITY * Con...

Thinking Sphinx Combining :with parameters

Hi guys, I was wondering how I could combine the result sets of Thinking Sphinx I have the following query: Model.search :with => {:attribute_1 => id} Which I want to combine with: Model.search :with => {:attribute_2 => id} Is there a neat way to do this with just one search? I could do array addition but that does no seem to be ...

CircularReferenceError when serializing an ActiveRecord instance (fetched by using ThinkingSphinx) to JSON

I try to serialize an instance of my ActiveRecord model to JSON (using "render :json => @entities" or "@entities.to_json"), but I always get an CircularReferenceError ("ActiveSupport::JSON::Encoding::CircularReferenceError (object references itself)"). This only happens when the ActiveRecord instances are queried by using ThinkingSphinx....

Using main and delta indexes in sphinx

Im switching fulltext searching on my site to sphinx. Im going to be using SphinxSE to perform the searches. I created 2 indexes, as specified in the manual: http://www.sphinxsearch.com/docs/manual-0.9.9.html#live-updates It seems to work, and index different stuff in its own index, but Im somewhat confused about how I should handle th...

Thinking Sphinx search with two classes and eager loading

I use TS to search trough 2 models (classes) at the same time: class Product < ActiveRecord::Base belongs_to :user belongs_to :photo has_many :variants end class Article < ActiveRecord::Base belongs_to :user belongs_to :photo end In controller: @item_facets = ThinkingSphinx.facets( options[:search], ...

Thinking Sphinx not indexing associated data to model searched by.

In my Product.rb define_index do indexes :name, :sortable => true indexes brand has :id, kosher_id, gluten_free_id, lactose_free_id has stores(:id), :as => 'store_ids' has locations(:id), :as => 'location_ids' has categories(:id), :as => 'category_ids' has kosher(:passover), :as => 'kosher_passover' end ...

Delta indexes not working on servers when using Thinking Sphinx

I'm using delta indexing for my Thinking Sphinx indexes in my Rails project. In my machine (Mac OS X) it's working fine. I change a record and it immediately finds it. On the servers (Debian) it doesn't. I did run a sql query for delta = true and the I've got the expected recently changed records, so that part is working. In the log/sea...

Thinking Sphinx Rebuild, then whenever saving any page it does save, but return error.

I did a rake thinking_sphinx:rebuild, then when I try to update any page/entry, it does save but it returns error. New data is saved, but the page returns error. What have I done wrong? Before I did the above command, things were working fine. I had to issue that command because I did some changes on the sorting filter. ...

Thinking Sphinx Rake aborted, searchd is running whilr rebuilding or start/stop ts. Index works fine.

When I invoke rake ts:rebuild RAILS_ENV=production, I get the following: (in /var/www/abc.com/public/abc/releases/20101008073517) ** Erubis 2.6.6 Stopped search daemon (pid 22531). Generating Configuration to /var/www/abc.com/public/abc/releases/20101008073517/config/production.sphinx.conf Sphinx 1.10-beta (r2420) Copyright (c) 2001-20...