Hi all,
I'm trying to do that.
I'm using Globalize2 and Thinking Sphinx. But, i don't know how to
perform the facet query with the correct locale.
My UserProfile model (my job_experiences title have many locale)
# Definition de l index de recherche
define_index do
# Experience Pro (Name / Taille / Secteur / Fonction)
indexes job_experiences.job_experiences_translation.title, :as
=> :ts_job_experiences_title, :sortable => true, :facet => true
# Propriete sur les recherches
set_property :enable_star => 1
set_property :min_prefix_len => 1
end
And my Search query
@facets_user_profile = UserProfile.facets("*", :conditions => {:locale
=> 'fr-FR'})
And it result nothing
Anyone have a tip for me ?
Thank's in advance.
Mickaël.
On 10 mar, 09:13, Pat Allan <[email protected]> wrote:
> That's a tricky one - as all the Sphinx indexing is done before the
> user ever touches the website - if you could index all relevant
> languages, that would be the easiest approach. Beyond that, I'm not
> sure... if you could somehow construct fields with all the text for
> each language (ie, an English field, a German field, etc), then I
> guess you could limit queries against one of those fields.
>
> No solution's going to be elegant, I'm afraid.
>
> --
> Pat
>
> On 07/03/2009, at 12:30 AM, ACTRAiSER wrote:
>
>
>
> > Hi,
>
> > has anyone of you tried to integrate TS with Models translated via
> > Globalize2?
>
> > The thing is, that for example i have a Adress-Model which has a
> > state_id and country_id as they are associated to the State- and
> > Country- Models.
>
> > Those two Models are globalized which means they have a cooresponding
> > country_translations and state_translations table where there are
> > columns "locale" and "name" which are fetched depending on the
> > curren_user's setlocale.
>
> > So the problem is now, how do i have to setup my Adress-Index-
> > Attributes to find the correct address when the user enters for
> > example "Deutschland" in the search form to find all german Addresses?
>
> > Right now (as i dont know the answer, i do a really quirky workaround:
> > prior search i check via a normal activerecord-find-call if the search
> > term can be found in one of the translated models and if so, i fetch
> > the model-id. With the model id i can then start the Sphinx-Search.
> > But it would be somehow less painful if i can index the translated
> > fields in sphinx in the first place.
>
> > Long story short, any suggestions, best practise? :-)
>
> > Greets
> > -act
>
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---