On 1/29/2008, "Peter Vandenabeele" <[EMAIL PROTECTED]>
wrote:

>
>Jeff Cc wrote:
>> - No wildcards at all (Sphinx doesn't support them)
>
>Do you mean the "*" feature (prefix*  and *infix*) ? Where
>the search term "program*" matches the database text
>"program", "programmer", "programs" ...
>
>Those work for me in version sphinx-0.9.8-svn-r1065 and
>sphinx-0.9.8-svn-r1112 ... I have done quite some testing
>on r0165 (still testing the newest r1112) and that seems
>to work OK for me. Set the "enable_star" to 1 and set a
>min_prefix_leng or a min_infix_leng.

Yup, works for me too - it's just not turned on by default. The
enable_star feature has been around in at least the last 4 releases of
0.9.8. Fairly certain it's not in 0.9.7 though (the last 'production'
release).

>
>> - No automatic updates - must rebuild entire index using cron jobs.
>
>Indeed. But automatic rotation of indexes seems to work OK.
>Indexing on my dataset takes 15 seconds (37000 records,
>28 MByte) on a desktop PC.

Thinking Sphinx has delta indexes, which keep track of changes between
explicit indexes. I know Evan's working on adding something like this
to UltraSphinx as well.

The super small delta indexes means they get indexed really quickly,
straight after a model is updated.

>
>> Again using straight SQL, not the current state of your models
>

You're correct that UltraSphinx doesn't support model methods (as
opposed to standard attributes) are not accessible for index generation
- that's the same with Thinking Sphinx and perhaps all of the other
plugins as well.

Because you're dealing with MySQL directly when the data is indexed,
there's no instantiation of models (and no Ruby at all), so it's not
really an option. If the data you want isn't available somewhere in the
database, you're out of luck.

Ferret uses model methods, I believe, if that's an option available to
you.

>At least in one (limited) test, I have just used the :include
>feature of ultrasphinx and that automatically created the SQL
>for the  sphinx configuration file. So, if I understand well,
>that did use the AR model ?
>
>From:
>http://blog.evanweaver.com/files/doc/fauna/ultrasphinx/classes/ActiveRecord/Base.html
>
>* Including a field from an association
>
>Use the :include key.
>
>Accepts an array of hashes.
>
>  :include => [{:association_name => 'category', :field => 'name', :as
>=> 'category_name'}]
>
>Each should contain an :association_name key (the association name for
>the included model), a :field key (the name of the field to include),
>and an optional :as key (what to name the field in the parent).
>
>So in my Model for jobs, that is as simple as e.g.:
>
>class Job < ActiveRecord::Base
>
>  is_indexed :fields => [
>    'title']
>  :include => [
>    {:association_name => 'employer', :field => 'name'}]
>
>  belongs_to :employer
>...
>

Thinking Sphinx equivalent (just to provide a comparison):

class Job < ActiveRecord::Base

  define_index do |index|
    index.includes.title
    index.includes.employer.name
  end

  # ...
end

Cheers

--
Pat

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Deploying Rails" group.
To post to this group, send email to rubyonrails-deployment@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-deployment?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to