Hi Martin

I would recommend shifting location into its own model/table - that way, you 
can then filter by location_id as a multi-value integer facet, which removes 
the need to CRC32 each location value and load User models (and with that many 
values, CRC32 could easily have collisions for different strings).

Cheers

-- 
Pat


On 13/12/2012, at 1:59 AM, Martin Streicher wrote:

> I have a Rails model named User. The model has a field named location with 
> contents such as 'Miami, FL'.
> 
> I set this field to be a facet.
> 
> There are about 135K user records. 
> 
> When I run something like
> 
> User.facets facets: [:location]
> 
> it causes a MySQL query of SELECT * from users. After a while, it does yield 
> a hash of facets with locations and counts, but it takes too long to be 
> viable in production. 
> 
> I want to use the facets -- location and a few others -- to provide a context 
> sensitive search refinement. I need the string values of location.
> 
> Is there any good way to do this? Why do the facets cause the query? I assume 
> the CRC32 values are stored in Sphinx, but it needs the strings to do the 
> human-readable mapping?
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Thinking Sphinx" group.
> To view this discussion on the web visit 
> https://groups.google.com/d/msg/thinking-sphinx/-/PHEFtkynXnsJ.
> 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