Hi Ben
What you're trying to do isn't possible at the moment - Sphinx doesn't
treat string attributes as strings, so you can't filter on them.
See
http://groups.google.com/group/thinking-sphinx/browse_thread/thread/7e8bb5ec3afc25f7
for a bit more information.
It is somewhat possible to do what you want using a field instead, but
it will match any tokens in the field, not the field in its entirety.
--
Pat
On 06/03/2009, at 10:04 PM, Benjamin wrote:
>
> Hey ..
>
> first of all, thank you for thinking sphinx, its a pleasure working
> with this piece of software. But i wouldn't write to this list if i
> wouldn't have a small problem ;-)
>
> Please take a look at this small class:
>
> class MovieData < ActiveRecord::Base
> define_index do
> indexes original_title, production_year
> has movie_id, source_name, source_id
> end
> end
>
>
> I'm now trying to fetch certain objects with or without a specific
> source name. I reindexed and did restart my thinking_sphinx demon. The
> following two commands are not working as expected (using :with
> and :without a certain attribute)
>
>>> MovieData.search(:with => { :source_name =>
>>> "zelluloid" }, :per_page => 3).map(&:source_name)
> => ["yovideo", "yovideo", "yovideo"]
>>> MovieData.search(:without => { :source_name =>
>>> "zelluloid" }, :per_page => 3).map(&:source_name)
> => ["zelluloid", "zelluloid", "zelluloid"]
>
> but for some reason, this works:
>
>>> MovieData.search(:without => { :source_name =>
>>> "yovideo" }, :per_page => 3).map(&:source_name)
> => ["zelluloid", "zelluloid", "zelluloid"]
>>> MovieData.search(:with => { :source_name => "yovideo" }, :per_page
>>> => 3).map(&:source_name)
> => ["yovideo", "yovideo", "yovideo"]
>
> Any idea on what could be wrong? I'm using Sphinx 0.9.8.1 and thinking
> sphinx 1.1.5 (2009-02-09)
>
> Cheers
> Ben
>
> >
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---