Ah, and that'll teach me for not suggesting an update to start with. Sorry! 
Good to know everything's happy now :)

-- 
Pat

On 17/09/2010, at 2:03 AM, Benjamin Lim wrote:

> It looked like it was an issue with the subclasses and a peek at the
> git repo showed that some updates related to STI and facets had been
> made recently. As a result, I upgraded to version 1.3.20 and now
> everything seems to be working fine. Thanks again for your help!
> 
> On Sep 16, 10:33 am, Benjamin Lim <[email protected]> wrote:
>> I've narrowed it down to an issue with this index:
>> 
>>   define_index do
>>     indexes :title
>>     indexes :body
>>     indexes :quote
>>     indexes :source
>>     indexes :video_caption
>>     indexes :body2
>>     indexes author.first_name, :as => :author_first_name
>>     indexes author.last_name, :as => :author_last_name
>>   end
>> 
>> I've commented out the other two classes and am still getting the same
>> errors.
>> 
>> This class contains three subclasses that are being searched. Could
>> that have something to do with it?
>> 
>> On Sep 16, 10:25 am, Benjamin Lim <[email protected]> wrote:
>> 
>>> When I comment out the third of those indexes and just search two of
>>> them, "Stanley" and "Kubrick" both work fine even though they're not
>>> returning any results for one of the classes.
>> 
>>> On Sep 16, 10:15 am, Benjamin Lim <[email protected]> wrote:
>> 
>>>> Yup, the same goes for "Stanley," it yields zero results for one of
>>>> the classes.
>> 
>>>>   define_index do
>>>>     indexes film.title, :as => :title
>>>>     indexes film.alternate_title, :as => :alternate_title
>>>>     indexes country
>>>>     indexes excerpt
>>>>     indexes synopsis
>>>>     indexes film.language, :as => :language
>>>>     indexes special_features
>>>>     indexes director
>>>>     indexes films.primary_title, :as => :films_in_set
>>>>     indexes film.cast_members.name, :as => :cast_members
>>>>   end
>> 
>>>>   # This is the entry that is not yielding results for "Stanley" and
>>>> "Kubrick"
>>>>   define_index do
>>>>     indexes :title
>>>>     indexes :body
>>>>     indexes :excerpt
>>>>     indexes films.title, :as => :film_title
>>>>     indexes explore_entry_films.description, :as => :film_description
>>>>   end
>> 
>>>>   define_index do
>>>>     indexes :title
>>>>     indexes :body
>>>>     indexes :quote
>>>>     indexes :source
>>>>     indexes :video_caption
>>>>     indexes :body2
>>>>     indexes author.first_name, :as => :author_first_name
>>>>     indexes author.last_name, :as => :author_last_name
>>>>   end
>> 
>>>> On Sep 16, 8:40 am, Pat Allan <[email protected]> wrote:
>> 
>>>>> Really strange indeed.
>> 
>>>>> What does the define_index block look like for these models? What happens 
>>>>> if you comment out all attributes in each model, and try the facet 
>>>>> searches then?
>> 
>>>>> Maybe you're right about the class that has 0 results causing the 
>>>>> problem... Is that the case for "Stanley" as well?
>> 
>>>>> --
>>>>> Pat
>> 
>>>>> On 15/09/2010, at 1:05 AM, Benjamin Lim wrote:
>> 
>>>>>> This is really strange.
>> 
>>>>>> If I do a search for "Kubrick Spartacus" I get 5 results and when I
>>>>>> try to get the facets for that search I get the error.
>> 
>>>>>> If I do a search for "Spartacus" I get those 5 results plus some other
>>>>>> ones but the facets for that search work fine.
>> 
>>>>>> Actually (I just realized this in the middle of typing this)... I have
>>>>>> three classes that I'm searching and in "Kubrick Spartacus" only two
>>>>>> of those classes are represented in the search results. In "Spartacus"
>>>>>> there are results from all three classes. Could one of the classes
>>>>>> yielding zero results be causing this?
>> 
>>>>>> On Sep 14, 1:41 am, Pat Allan <[email protected]> wrote:
>>>>>>> Hi Benjamin
>> 
>>>>>>> I guess from here, it's a matter of deduction... when you do a normal 
>>>>>>> search for 'kubrick' (since that's probably slightly more rare?), how 
>>>>>>> many search results do you get? (Don't forget results are paginated)
>> 
>>>>>>> And then, what can you add to the query to get fewer results where the 
>>>>>>> facet query still fails? Can you get that down to just a single record? 
>>>>>>> Or maybe there's a few records with this data glitch...
>> 
>>>>>>> --
>>>>>>> Pat
>> 
>>>>>>> On 14/09/2010, at 1:06 AM, Benjamin Lim wrote:
>> 
>>>>>>>> The failing queries are "stanley" and "kubrick" so it's possible that
>>>>>>>> it's breaking because of one of the results being returned since I
>>>>>>>> suspect both queries return similar results. There was another one
>>>>>>>> that consistently failed as well but I can't recall what it was.
>> 
>>>>>>>> The ones that work all consistently work.
>> 
>>>>>>>> On Sep 10, 10:48 pm, Pat Allan <[email protected]> wrote:
>>>>>>>>> Hi Benjamin
>> 
>>>>>>>>> Does it happen reliably for some queries? If so, can you give me an  
>>>>>>>>> example of a failing query?
>> 
>>>>>>>>> Cheers
>> 
>>>>>>>>> --
>>>>>>>>> Pat
>> 
>>>>>>>>> On 11/09/2010, at 5:50 AM, Benjamin Lim <[email protected]> wrote:
>> 
>>>>>>>>>> I'm currently getting the error below when trying to use facets.
>> 
>>>>>>>>>> I haven't specified any facets in my indexes, I'm just trying to get 
>>>>>>>>>> a
>>>>>>>>>> breakdown of the results from each class that I'm getting back for my
>>>>>>>>>> search. The strange thing is that it works for some queries and
>>>>>>>>>> returns this error for others. At first I thought it might be 
>>>>>>>>>> specific
>>>>>>>>>> to one of the classes being searched but I did a search for "" and
>>>>>>>>>> returned everything that's in the index and that worked fine...
>> 
>>>>>>>>>> The error message:
>> 
>>>>>>>>>> NoMethodError (undefined method `value' for nil:NilClass):
>>>>>>>>>>  /usr/local/lib/ruby/gems/1.8/gems/thinking-sphinx-1.3.18/lib/
>>>>>>>>>> thinking_sphinx/facet_search.rb:114:in `add_from_results'
>>>>>>>>>>  /usr/local/lib/ruby/gems/1.8/gems/thinking-sphinx-1.3.18/lib/
>>>>>>>>>> thinking_sphinx/search.rb:221:in `each_with_groupby_and_count'
>>>>>>>>>>  /usr/local/lib/ruby/gems/1.8/gems/thinking-sphinx-1.3.18/lib/
>>>>>>>>>> thinking_sphinx/search.rb:220:in `each'
>>>>>>>>>>  /usr/local/lib/ruby/gems/1.8/gems/thinking-sphinx-1.3.18/lib/
>>>>>>>>>> thinking_sphinx/search.rb:220:in `each_with_index'
>>>>>>>>>>  /usr/local/lib/ruby/gems/1.8/gems/thinking-sphinx-1.3.18/lib/
>>>>>>>>>> thinking_sphinx/search.rb:220:in `each_with_groupby_and_count'
>>>>>>>>>>  /usr/local/lib/ruby/gems/1.8/gems/thinking-sphinx-1.3.18/lib/
>>>>>>>>>> thinking_sphinx/facet_search.rb:113:in `add_from_results'
>>>>>>>>>>  /usr/local/lib/ruby/gems/1.8/gems/thinking-sphinx-1.3.18/lib/
>>>>>>>>>> thinking_sphinx/facet_search.rb:49:in `populate'
>>>>>>>>>>  /usr/local/lib/ruby/gems/1.8/gems/thinking-sphinx-1.3.18/lib/
>>>>>>>>>> thinking_sphinx/facet_search.rb:47:in `each'
>>>>>>>>>>  /usr/local/lib/ruby/gems/1.8/gems/thinking-sphinx-1.3.18/lib/
>>>>>>>>>> thinking_sphinx/facet_search.rb:47:in `populate'
>>>>>>>>>>  /usr/local/lib/ruby/gems/1.8/gems/thinking-sphinx-1.3.18/lib/
>>>>>>>>>> thinking_sphinx/facet_search.rb:13:in `initialize'
>>>>>>>>>>  /usr/local/lib/ruby/gems/1.8/gems/thinking-sphinx-1.3.18/lib/
>>>>>>>>>> thinking_sphinx/search_methods.rb:422:in `new'
>>>>>>>>>>  /usr/local/lib/ruby/gems/1.8/gems/thinking-sphinx-1.3.18/lib/
>>>>>>>>>> thinking_sphinx/search_methods.rb:422:in `facets'
>>>>>>>>>>  app/controllers/search_controller.rb:15:in `results'
>> 
>>>>>>>>>> --
>>>>>>>>>> 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 
>>>>>>>>>> athttp://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 
>>>>>>>> athttp://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 
>>>>>> athttp://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.
> 

-- 
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