Hi Jeff
I've no idea what's causing this, but let's start with a clean slate:
rake ts:rebuild
Then what's the result of Events::Event.search_count?
And when you remove the attribute and run 'rake ts:rebuild' again, what's the
new overall count?
--
Pat
On 12/10/2010, at 6:25 AM, JeffLuckett wrote:
> I am trying to set up the ability to search for Events that are
> happening in the future.
>
> If I define my index thusly:
>
> define_index do
> indexes :name
> indexes :description
> indexes creator.display_name, :as => :artist_display_name
> indexes venue.name, :as => :venue_name
> indexes venue.region, :as => :venue_state
> indexes performers.name, as => :performer_name
> where "creator_id is not null and deleted = false"
>
> set_property :delta => true
> end
>
> The following query returns ~250 results:
> Events::Event.search( 'amanda', :star=>true)
>
> So, I want to limit my result set to only future events, so I modify
> my index as such:
>
> define_index do
> indexes :name
> indexes :description
> indexes creator.display_name, :as => :artist_display_name
> indexes venue.name, :as => :venue_name
> indexes venue.region, :as => :venue_state
> indexes performers.name, as => :performer_name
>
> has local_start_time, as => :event_date
>
> where "creator_id is not null and deleted = false" #
> set_property :delta => true
> end
>
> After a rebuild, I run the identical query above as a sanity check,
> and it returns only 2 records!
> Events::Event.search( 'amanda', :star=>true)
>
> ADDITIONALLY:
> Adding a :with clause to the query has no effect. Also, the 2 results
> the query returns are in the past...
>
> Events::Event.search( 'amanda', :star=>true, :with=>{:event_date =>
> Time.now...90.days.from_now})
>
> (I have also tried it without the :star option, and just directly
> wildcarding my search term.)
>
>
> To summarize:
> 1. Why is adding an attribute affecting my query results when the same
> query is run before and after adding the attribute.
> 2. Why is the :with option being ignored after adding the attribute.
>
> The local_start_time column is a datetime, and there are no nulls in
> any record in the table.
>
> I hope this is clear, let me know if I can provide any more info.
>
> 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.
>
--
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.