Hello,

My user model contains a 'gender' field, which is populated with
either 'male' or 'female'. My define_index block includes the line:
indexes gender.

When I try searching from the web interface, I add :conditions =>
{:gender => params[:gender]} to filter by gender. However, I keep
getting an empty result set. I checked the logs and found that sphinx
is actually searching for '@gender male'.

So, I opened up a console, and I tried searching using the :conditions
=> {:gender => 'male'} and another search using '@gender male'. Sure
enough, the first one returns results as intended, and the latter
returns an empty array.

If I understand correctly, using the @ syntax in search is for
attributes, not fields. So I tried to add :sortable => true to my
index gender line. (sortable => true adds another attribute to sort
by, right?). However, this didn't change anything.

My questions:
1) When I try to search using :conditions => { ... }, why is it
getting converted to '@gender male'?
2) Why is it failing to find any results?

Using rails 2.3.5, ruby 1.8.7, sphinx 0.9.9, and thinking sphinx
1.3.16

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.

Reply via email to