Closed Bodacious closed 13 years ago
The problem is that Sphinx doesn't allow filtering on string attributes - there's a suggestion or two for a work-around in the documentation: http://freelancing-god.github.com/ts/en/common_issues.html#string_filters
On 13/06/2011, at 2:58 AM, Bodacious wrote:
Hey man...
Here's my index rules in my Story model:
define_index do indexes title indexes description indexes transcript indexes taggings.tag.name, :as => :tags has state, story_type, vertical_id, user_id, created_at, published_at set_property :field_weights => { :tags => 1, :description => 10, :transcript => 15, :title => 20, } endWhen I do:
Story.search("the", :with => { :vertical_id => vertical.id }) # => 25 resultsbut when I add
Story.search("the", :with => { :vertical_id => vertical.id, :state => "published"}) # => 0 resultsI know there are results in the DB that match that query so it seems that TS doesn't like my "state" attribute. State is just a string field - almost all of the records on the db stories table are state = 'published'.
Am I doing something wrong here or is this a bug?
Ruby 1.9.2 Rails 3.1.0.rc4
Reply to this email directly or view it on GitHub: https://github.com/freelancing-god/thinking-sphinx/issues/239
So this was an RTFM issue.
I've bought the Thinking Sphinx PeepCode PDF to rectify this
Bo
Hey man...
Here's my index rules in my Story model:
When I do:
but when I add
I know there are results in the DB that match that query so it seems that TS doesn't like my "state" attribute. State is just a string field - almost all of the records on the db stories table are state = 'published'.
Am I doing something wrong here or is this a bug?
Ruby 1.9.2 Rails 3.1.0.rc4