That wasn't very clear. Some of the parts of the concatenation are associations, so if I add them as sql, I won't get the generation of the association join.
On Jun 11, 10:12 am, steve <[email protected]> wrote: > Turns out that conditional field is a concatenation of a couple > fields, so I'll have to put the whole thing in sql, is there a way > from the define_index to add joins? > > On Jun 11, 9:33 am, steve <[email protected]> wrote: > > > Pat, thank you, that would do it. > > > On Jun 10, 8:30 pm, Pat Allan <[email protected]> wrote: > > > > Hi Steve > > > > James' suggestion is perfect if you want to exclude records that > > > aren't public from all searches. > > > > However, it sounds like you may want to exclude certain fields > > > depending on whether the user has their profile marked as public or > > > not. This isn't built-in to Sphinx or Thinking Sphinx, but you should > > > be able to achieve it using something like the following: > > > > define_index do > > > indexes "IF(public = 1, location, '')", :as => :location > > > # repeat for relevant fields > > > end > > > > Hope this helps. > > > > -- > > > Pat > > > > On 10/06/2009, at 8:53 PM, James Healy wrote: > > > > > steve wrote: > > > >> I have some fields that belong to users that I would like to be > > > >> indexable. However there are preferences for that user to make that > > > >> information public or not. I'm trying to figure out how to only > > > >> include the attribute in the index if it was it's public for that > > > >> record. > > > > > assuming you have a database column called public, try: > > > > > define_index do > > > > ... > > > > ... > > > > > where "public = 1" > > > > end > > > > > -- James Healy <jimmy-at-deefa-dot-com> Thu, 11 Jun 2009 10:51:03 > > > > +1000 > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
