A good night's sleep makes a big difference.  I've changed my
define_index to:

define_index do
  indexes custom
  indexes zipcode
end

And my code to:

Resume.search('foo',  :conditions => {:zipcode => "02474|02482"})

That seems to do the trick.  Just need to grok the behavior/syntax a
little more and I think I'll be good, thanks for listening :-D

Cheers,
Rob

On May 28, 8:37 pm, Rob Sterner <[email protected]> wrote:
> My apologies up front for what's probably something trivial, but I'm
> beating my head against the wall trying to get this query to work.  My
> define_index in resume.rb:
>
> define_index do
>   indexes custom
>   has zipcode
> end
>
> My attempt to use said index:
>
> Resume.search('foo', :with => {:zipcode => ["90210","12345"]})
>
> This comes up dry every time.  The database column resumes.zipcode is
> a varchar(10).  Ideally I'd get back a result set of Resumes with
> 'foo' somewhere in resumes.custom within resumes.zipcode matching one
> of the ZIP codes passed.
>
> This, obviously, works great (note they're Integers, not Strings):
>
> Resume.search('foo', :with => {:zipcode => (0..99999)})
>
> Trying to craft a custom Range to pass, for example
>
> (02474..02482)
>
> gives me a nice `Illegal octal digit` SyntaxError.
>
> Any help is much appreciated, many thanks in advance!

-- 
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