thinking-sphinx

How do I retreive relevance value for ThinkingSphinx search results?

Is there any way to retrieve relevance values with results with the array returned by ThinkingSphinx? Percentages, points or whatever, just something I can work with? ...

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

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

How do I geo-search multiple models with ThinkingSphinx?

Hello, I have two models indexed for searching (User and Item). I'm trying to do a geo-search across models: ThinkingSphinx::Search.search('keywords', :geo => [ degrees_to_radians(params[:lat].to_f), degrees_to_radians(params[:lon].to_f) ], ) But I only get an error: Sphinx Error: index item_core,item_delta,user_core,user_delt...

Can I identify matched terms when searching with sphinx?

I am using sphinx to do full text search on a mysql database through thinking sphinx. I would like to highlight the matched terms in the results I show to the user. Shpinx is smart enough that searching for 'botulism' will match "i like to inject botulinum into my eyes" How can I get it to tell me that 'botulinum' matches 'botulism'? ...

Filtering Sphinx search results by date range

I have Widget.title, Widget.publish_ at, and Widget.unpublish_ at. It's a rails app with thinking_sphinx running, indexing once a night. I want to find all Widgets that have 'foo' in the title, and are published (publish _at < Time.now, unpublish _at > Time.now). To get pagination to work properly, I really want to do this in a sphinx ...

How does Sphinx store null fields, and how does this affect performance?

I'm thinking about using asking sphinx to index many fields (in the hundreds), many of which will be null. My question is how much having many null fields will affect performance? This situation arises not from having incredibly denormalized data, but from requirements on the search interface and what can be searched. Basically I will b...

Thinking Sphinx indexing non-expired records.

What would be the best approach to have Thinking Sphinx only index records where Today's date is less than or equal to the record's "expires_at" field? Thanks in advance. ...

Running Thinking Sphinx in two applications under passenger

I have two different rails applications running thinking_shpinx, and one seems to not be using the correct index. I tried setting the port in the sphinx.yml but it seems to not have any effect. ...

Sphinx returning bad search results

I am using Sphinx with the Thinking Sphinx plugin. I have indexed a model called Venue with the following code (and the rake thinking_sphinx:index command) define_index do indexes :name indexes city indexes zip end I obtain the results in my controller with this code: @venues = Venue.search params[:search] and I render...

Sphinx, Rails, ThinkSphinx and making some words matter more than others in your query.

I have a list of keywords that I need to search against, using ThinkingSphinx Some of them being more important than others, i need to find a way to weight those words. So far, the only solution i came up with is to repeat x number of times the same word in my query to increase its relevance. Eg: 3 keywords, each of them having a level ...

How do I start the sphinx daemon automatically when my rails application loads?

I am aware of the command to start the sphinx daemon manually. I use a rake task: "rake thinking_sphinx:start" Is it possible to have it start whenever my rails application loads so I don't have to manually type in the command every time? ...

Thinking Sphinx - RuntimeError: Missing Attribute for Foreign Key ...

Trying to get along with Sphinx/Thinking Sphinx for the first time. I've got my models defined as follows (simplified): class Branch < ActiveRecord::Base has_many :salesmen, :class_name => "User" has_many :leads, :through => :salesmen end class User < ActiveRecord::Base belongs_to :branch has_many :leads, :foreign_key => "ow...

ThinkingSphinx not accepting conditions

I'm having trouble getting ThinkingSphinx to recognize my conditions. My Discussion model includes the following code: define_index do indexes [subject, body], :as => :text indexes replies.body, :as => :reply_text set_property :delta => true end And as expected this search Discussion.search "handy" returns any discussion wit...

Thinking Sphinx - Delta indexing doesn't work

In my app, I need every new record to be added to the index instantly (not after rake ts:index). If I understand it correctly delta indexing is what I'm looking for. So, I added delta column to every table I'm indexing with Sphinx, set the default value to false and added set_property :delta => true to every define_index block; then ran ...

Rails: Integration testing thinking_sphinx with cucumber and webrat - how do I index transactional fixtures?

I'd like to have some Cucumber/webrat integration tests of my search features that use thinking_sphinx & sphinx but the problem is that the data is loaded and then rolled back in a transaction during a typical cucumber test so there is no way for thinking_sphinx to index it. Alternatively, is there a way to turn transactions off for jus...

Specifying Different Column as DOC ID using Thinking Sphinx

I am using the great Thinking Sphinx plugin for accessing Sphinx Search in RoR 2.2.3. I have a cache table that stores pre-compiled views. This is the source data table for Sphinx. However, the ID column on this table is basically garbage, and the ID that I want is stored in another column (cacheable_id). How can I setup Thinking Sphin...

Sphinx ordering: nil/NULL values last

On a Rails project, I'm using Sphinx together with Thinking Sphinx plugin. I index a table with an attribute :foo that is a float. My desired behaviour when sorting for column :foo would be that nil values always appear at the end of the list, e.g. id; foo (order foo desc) ------- 1; 5 2; 3 3; -4 4: -5 5: nil 6: nil id; foo (order f...

Accent Insensitive ordering in Sphinx

I am using Sphinx with the Thinking Sphinx plugin to search my data. I am using MySQL. My data contains accented chars ("á", "é", "ã") and I want them to be equivalent to their non-accented counterparts ("a", "e", "a", for example) when searching and ordering. I got the search working using a charset table (pastie.org/204316), and a se...

Thinking Sphinx Search Box

I'm trying to get Thinking Sphinx running on my site but I'm not sure how to set up the search box and button for the index page. I have in my model: define_index do indexes :name indexes description where "approved = 'true'" end In my controller: def index @businesses = Business.search params[:search] end And in my in...

Thinking_Sphinx search options

Similar Stack Overflow Question I want users to be able to search through my thinking_sphinx text box a word like wood and have it pull up Wooden and Woodworking. This words fine if the user types in wood*, but if they type in just wood with no * then no results are shown. If there a way to get the results of wood* without having to ty...