Noteworthy: The wrong facet counts also occur with an "older" index
version that doesn't include the hacks and string attributes, so I
guess that's not related. It could also be that it happened with
Sphinx 0.9.9 as well – not sure.

On Feb 4, 11:57 am, Clemens Kofler <[email protected]> wrote:
> Hi,
>
> I'm having strange issues with facets after updating to Sphinx 1.10
> beta (including a little hack – I'll come to that in a second).
>
> Here's roughly what's happening (on the console, but it's the same via
> the web):>> Product.facets(:facets => [:category_path, :brand])
>
> Riddle::ResponseError: No response from searchd (status: , version: )
>         from /Users/clemens/.rvm/gems/ruby-1.8.7-p302@rpx/gems/riddle-1.2.2/
> lib/riddle/client.rb:611:in `request'
>         ...>> Product.facets(:facets => :brand)
>
> => {:brand=>{2583853161=>63, ... }>> Product.facets(:facets => :category_path)
>
> => {:category_path=>{"2087,2173"=>1, ... }
>
> So I can get both facets separately with no issues but if I try to
> query them at once it doesn't work.
>
> Here's the index and the aforementioned hack as well as my stab at
> "treed facets":https://gist.github.com/810978
>
> A word on the structure of categories: Each product belongs to a
> category and categories are part of a tree where I also store the path
> (say, Electronics > Computers > Portable could be ids 1, 2 and 3, so
> the path would be 1,2,3). The first MVA is so I can use it in a filter
> (:with => { :category_ids => [1] } should return all products
> categorized in category 1 and any of its children), the second MVA is
> so I can re-create the tree from the facet without having to
> instantiate products/categories (can't do that with the first MVA
> because it sorts the ids so a path of "1,100,10" would become
> "1,10,100" which is not the correct tree structure anymore and
> therefore messes up my facets).
>
> I mention this because another problem happens here: Facet counts get
> messed up because some records don't seem to be counted in the facets
> although they are (or should be) in the index. For example, the facet
> value for a (parent) category named "Accessoires" might be 15 but when
> I search with the same parameters I get 16 hits. It's not an off-by-
> one error because for other facets there are different error margins.
> I've tried debugging it by taking a look at the index SQL but the only
> thing I see in common is that the CRC32 of the missing records seems
> different:
> "22,25" => 3446997767
> "22,28" => 3015999418
> "22,29" => 3301134124
> but
> "22,27" => 595288619
>
> It seems that the records with the "different" CRC32 values aren't
> picked up by the facets. I've tried debugging the shit out of TS ;-)
> and inspected pretty much every step of the facet search and can't
> find the "22,27" value anywhere – I have no idea why it's not there.
>
> The env:
> - Ruby 1.8.7
> - Rails 3.0.3
> - Thinking Sphinx 2.0.2
> - Riddle 1.2.2
> - Sphinx 1.10-beta
>
> I hope the problems are somewhat clear. I'd be grateful for any
> pointers where to look for errors.
>
> Thanks in advance,
> - C.

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