Thanks James, as you guessed it looks like at least part of my problem
was a charset_table issue, looks like a "." is used as a separator in
sphinx. I added this to sphinx.yml and got a little further:

charset_table = 0..9, A..Z->a..z,a..z,., _, -, /, @, !, $, %, ^, &,
(, ), +, `, ~

I still have an issue with hyphens... a condition
of :size=>"10-12-14"  seems not to match even though facet count
returns the correct amount(this is where my shoe example stops being a
good analogy). I'm digging into causes right now, but I think I'm
almost out of the woods, I appreciate the help!


On Nov 4, 1:43 pm, James Earl <[email protected]> wrote:
> Thinking Sphinx creates a duplicate attribute called
> [field_name]_facet, which you can use with the :with option after
> crc'ing the value.
>
> Product.facets(:with => {:field_facet => '10'.to_crc32})
>
> As for why you get 9 instead of 4, it may be because searching for 10
> matches both 10 and 10.5 (which might be indexed without the "."???).
>
> James
>
> On Wed, Nov 4, 2009 at 2:35 PM, Alan <[email protected]> wrote:
>
> > Ok, I stumbled upon this issue, and I'm wondering if this is a bug or
> > perhaps I'm not using TS correctly. Using the sample data models
> > below, I get the following behavior(assume I have two shoe sizes "10"
> > and "10.5", where both are strings).
>
> > Product.facets
> > #returns :shoe_size=>{"10"=>4, "10.5"=>5}
> > if I then run:
>
> > Product.facets :conditions=>{:shoe_size=>"10"}.for.size
>
> > I get 9, vs the expected 4.
>
> > Any idea why this happens? It's as if facets is doing an exact match,
> > but when I actually add on as a condition, it seems to do a partial
> > match?
>
> > Perhaps related to this.. Is the with vs condition parameter. Although
> > I get deprecation warnings about using :with vs :conditions, it seems
> > as if only :conditions works
>
> > **********
> > class Product
> > has_many shoe_options
> > def_index
> > indexes shoe_options.shoe_size :as=> shoe_size, :facet=>true
> > end
> > end
>
> > class ShoeOption
> > belongs_to shoe
> > end
--~--~---------~--~----~------------~-------~--~----~
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