I'm struggling to get a simple :with clause to work. I can use the
with clause to exclude soft deleted items without any problems as
such:
>> Contact.search('test contact', {:order=>"first_name asc", :with=>{:deleted
>> => 0}, :star=>true})
Sphinx Querying: '*test* *contact*'
Sphinx (0.005511s) Found 1 results
Contact Load (0.4ms) SELECT * FROM `contacts` WHERE
(`contacts`.`id` IN (2595) AND `contacts`.`deleted` = 0)
=> [#<Contact id: 2595, first_name: "test", last_name: "contact",
email: "[email protected]", phone: nil, fax: nil, title: nil, street:
nil, city: nil, state: nil, zip: nil, country: nil, owner_table:
"companies", owner_id: "1573", user_id: 21, delta: false, deleted:
false, created_at: "2010-11-10 01:38:00", updated_at: "2010-11-10
01:38:00">]
However, when I add additional fields to the with clause, the query
returns 0 results:
>> Contact.search('test contact', {:order=>"first_name asc", :with=>{:deleted
>> => 0, :owner_table => "companies", :owner_id => 1573}, :star=>true})
Sphinx Querying: '*test* *contact*'
Sphinx (0.003964s) Found 0 results
=> []
I've tried different variations of the with clause, but it always
returns 0 results. My define_index block looks like:
define_index do
indexes :first_name, :sortable => true
indexes :last_name, :sortable => true
indexes :email, :sortable => true
has :deleted, :owner_table, :owner_id
set_property :delta => :delayed
set_property :field_weights => {:first_name => 10, :last_name =>
7, :email => 5 }
end
I'm using the following:
rails (2.3.4)
thinking-sphinx (1.3.20)
ts-delayed-delta (1.1.1)
Sphinx 0.9.9-release (r2117)
Any ideas? Thanks.
--
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.