Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Ranges in search conditions
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Tiago Franco  
View profile  
 More options Apr 7 2010, 7:25 am
From: Tiago Franco <gama.fra...@gmail.com>
Date: Wed, 7 Apr 2010 04:25:29 -0700 (PDT)
Local: Wed, Apr 7 2010 7:25 am
Subject: Re: Ranges in search conditions
Ok, this is how I've done it.

Create an attribute index based on an SQL snippet (inside define_index
do...end):

has "CASE WHEN run_time IS NULL THEN 0 WHEN run_time < 30 THEN 1 WHEN
run_time > 30 AND run_time < 60 THEN 2 ELSE 3 END", :type
=> :integer, :as => :run_time_mapping

Then just search by that attribute (i.e. Music.search :with =>
{:run_time_mapping => [0,1]} )

Hope it helps.

Tiago Franco

On Apr 6, 11:45 pm, Tiago Franco <gama.fra...@gmail.com> wrote:

> Hi,

> I'm having the same issue. Is there a workaround for this?

> Thanks,
>   Tiago Franco

> On Mar 28, 6:18 am, Pat Allan <p...@freelancing-gods.com> wrote:

> > Hi Lucas

> > Unfortunately, the only way you can have OR behaviours in filters is searching across multi-value arrays (which are integers).Rangesdon't have this ability.

> > Sorry - good luck finding a solution that works around this limitation.

> > --
> > Pat

> > On 26/03/2010, at 10:00 PM, Sarniak wrote:

> > > Hi!
> > > I would like to build such query in sphinx:

> > > (start_date >= date.today AND start_date <= date.today + 23.hours +
> > > 59minutes) OR (start_date <= date.today AND end_date >= date.today)

> > > I found usingrangesin shinx like:

> > > :start_date => 1.week.ago..Time.now

> > > And I could use it, but only for either first or second part of OR. Is
> > > there possibility to somehow combine two parts of OR statement in
> > > sphinx?

> > > Regards
> > > Lucas

> > > --
> > > You received this message because you are subscribed to the Google Groups "Thinking Sphinx" group.
> > > To post to this group, send email to thinking-sphinx@googlegroups.com.
> > > To unsubscribe from this group, send email to thinking-sphinx+unsubscribe@googlegroups.com.
> > > For more options, visit this group athttp://groups.google.com/group/thinking-sphinx?hl=en.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.